amino  1.0-beta2
Lightweight Robot Utility Library
scene_fcl.h
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 4; -*- */
2 /* ex: set shiftwidth=4 tabstop=4 expandtab: */
3 /*
4  * Copyright (c) 2015, Rice University
5  * All rights reserved.
6  *
7  * Author(s): Neil T. Dantam <ntd@rice.edu>
8  *
9  * Redistribution and use in source and binary forms, with or
10  * without modification, are permitted provided that the following
11  * conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of copyright holder the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
31  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 
38 #ifndef AMINO_RX_SCENE_FCL_H
39 #define AMINO_RX_SCENE_FCL_H
40 
46 /* Utility */
47 #ifdef __cplusplus
48 
49 // #include <fcl/math/transform.h>
50 
51 #include "amino/tf.hpp"
52 #include "amino/eigen_compat.hpp"
53 
54 namespace amino {
55 namespace fcl {
56 
57 typedef double fcl_scalar;
58 
59 typedef ::fcl::CollisionGeometry<fcl_scalar> CollisionGeometry ;
60 typedef ::fcl::CollisionObject<fcl_scalar> CollisionObject ;
61 typedef ::fcl::Vector3<fcl_scalar> Vec3;
62 typedef ::fcl::OBBRSS<fcl_scalar> OBBRSS;
63 
64 typedef ::fcl::Box<fcl_scalar> Box;
65 typedef ::fcl::Sphere<fcl_scalar> Sphere;
66 typedef ::fcl::Cylinder<fcl_scalar> Cylinder;
67 
68 typedef ::fcl::CollisionRequest<fcl_scalar> CollisionRequest;
69 typedef ::fcl::CollisionResult<fcl_scalar> CollisionResult;
70 typedef ::fcl::Contact<fcl_scalar> Contact;
71 typedef ::fcl::BroadPhaseCollisionManager<fcl_scalar> BroadPhaseCollisionManager;
72 typedef ::fcl::DynamicAABBTreeCollisionManager<fcl_scalar> DynamicAABBTreeCollisionManager;
73 
74 typedef ::fcl::DistanceRequest<fcl_scalar> DistanceRequest;
75 typedef ::fcl::DistanceResult<fcl_scalar> DistanceResult;
76 
77 
78 
79 static inline ::fcl::Transform3<::amino::fcl::fcl_scalar>
80 qutr2fcltf( const double E[7] )
81 {
82  const double *q = E + AA_TF_QUTR_Q;
83  const double *v = E + AA_TF_QUTR_V;
84 
86  ::fcl::Transform3<::amino::fcl::fcl_scalar> result;
87  ::amino::conv(&oE, &result);
88  return result;
89 
90 
91  // return ::fcl::Transform3f(::fcl::Quaternionf( q[AA_TF_QUAT_W],
92  // q[AA_TF_QUAT_X],
93  // q[AA_TF_QUAT_Y],
94  // q[AA_TF_QUAT_Z]),
95  // ::fcl::Vec3f(v[0], v[1], v[2]));
96 }
97 
98 
99 
100 } /* namespace fcl */
101 } /* namespace amino */
102 
103 
104 #endif /* __cplusplus */
105 
106 #endif /*AMINO_RX_SCENE_FCL_H*/
amino namespace
Definition: amino.hpp:60
#define AA_TF_QUTR_V
Offset of translation part in quaternion-translation representation.
Definition: spatial.h:1184
#define AA_TF_QUTR_Q
Offset of quaternion part in quaternion-translation representation.
Definition: spatial.h:1178
A rotation quaternion and translation vector object.
Definition: spatial.hpp:845
static aa_tf_qv from_qv(const double a_r[4], const double a_v[3])
Create a quaternion-translation from a rotation quaternion and a translation vector.
Definition: spatial.hpp:951
Include this file for low-level operations for SE(3) orientations and transformations.