amino
Lightweight Robot Utility Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
scene_collision.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_COLLISION_H
39 #define AMINO_RX_SCENE_COLLISION_H
40 
48 AA_API void
49 aa_rx_cl_init( );
50 
56 struct aa_rx_cl_set;
57 
61 AA_API struct aa_rx_cl_set*
62 aa_rx_cl_set_create( const struct aa_rx_sg *sg );
63 
67 AA_API void
68 aa_rx_cl_set_destroy(struct aa_rx_cl_set *cl_set);
69 
73 AA_API void
74 aa_rx_cl_set_set( struct aa_rx_cl_set *cl_set,
77  int is_colliding );
78 
84 AA_API void
85 aa_rx_cl_set_fill( struct aa_rx_cl_set *dst,
86  const struct aa_rx_cl_set *src );
87 
91 AA_API int
92 aa_rx_cl_set_get( const struct aa_rx_cl_set *cl_set,
94  aa_rx_frame_id j );
95 
96 AA_API void
97 aa_rx_cl_set_merge(struct aa_rx_cl_set* into, const struct aa_rx_cl_set* from);
98 
102 struct aa_rx_cl;
103 
107 AA_API void
108 aa_rx_sg_cl_init( struct aa_rx_sg *scene_graph );
109 
113 AA_API struct aa_rx_cl *
114 aa_rx_cl_create( const struct aa_rx_sg *scene_graph );
115 
116 AA_API void
117 aa_rx_cl_allow_config( struct aa_rx_sg* scene_graph, const size_t n_q, const double* q);
118 
122 AA_API void
123 aa_rx_cl_destroy( struct aa_rx_cl *cl );
124 
128 AA_API void
129 aa_rx_cl_allow( struct aa_rx_cl *cl,
130  aa_rx_frame_id i,
131  aa_rx_frame_id j,
132  int allowed );
133 
137 AA_API void
138 aa_rx_cl_allow_set( struct aa_rx_cl *cl,
139  const struct aa_rx_cl_set *set );
140 
144 AA_API void
145 aa_rx_cl_allow_name( struct aa_rx_cl *cl,
146  const char *frame0,
147  const char *frame1,
148  int allowed );
149 
158 AA_API int
159 aa_rx_cl_check( struct aa_rx_cl *cl,
160  size_t n_tf,
161  const double *TF, size_t ldTF,
162  struct aa_rx_cl_set *cl_set );
163 
164 AA_API void
165 aa_rx_sg_allow_config( struct aa_rx_sg* scene_graph, const double* q);
166 
167 AA_API void
168 aa_rx_sg_cl_set_copy(const struct aa_rx_sg* sg, struct aa_rx_cl_set * cl_set);
169 
170 AA_API void
171 aa_rx_sg_get_collision(const struct aa_rx_sg* scene_graph, const double* q, struct aa_rx_cl_set* cl_set);
172 
173 #endif /*AMINO_RX_SCENE_COLLISION_H*/
AA_API struct aa_rx_cl_set * aa_rx_cl_set_create(const struct aa_rx_sg *sg)
Create a collision set.
AA_API void aa_rx_cl_set_destroy(struct aa_rx_cl_set *cl_set)
Destroy a collision set.
signed long aa_rx_frame_id
Type for frame indices.
Definition: scenegraph.h:48
AA_API void aa_rx_cl_set_set(struct aa_rx_cl_set *cl_set, aa_rx_frame_id i, aa_rx_frame_id j, int is_colliding)
Set the value of collision between frames i and j.
AA_API void aa_rx_sg_cl_init(struct aa_rx_sg *scene_graph)
Initialize the collision structures within scene_graph.
AA_API void aa_rx_cl_destroy(struct aa_rx_cl *cl)
Destroy a collision detection context.
AA_API void aa_rx_cl_allow(struct aa_rx_cl *cl, aa_rx_frame_id i, aa_rx_frame_id j, int allowed)
Allow (ignore) collisions between frames i and j if allowed is true.
AA_API struct aa_rx_cl * aa_rx_cl_create(const struct aa_rx_sg *scene_graph)
Create a new collision detection context for scene_graph.
AA_API void aa_rx_cl_allow_name(struct aa_rx_cl *cl, const char *frame0, const char *frame1, int allowed)
Allow (ignore) collisions between frames0 and frame1 if allowed is true.
AA_API void aa_rx_cl_init()
Initialize collision handling.
Opaque type for a scene_graph.
AA_API int aa_rx_cl_set_get(const struct aa_rx_cl_set *cl_set, aa_rx_frame_id i, aa_rx_frame_id j)
Return the value of collision between frames i and j.
#define AA_API
calling and name mangling convention for functions
Definition: amino.h:86
AA_API void aa_rx_cl_allow_set(struct aa_rx_cl *cl, const struct aa_rx_cl_set *set)
Allow collisions between all frame pairs in set.
AA_API int aa_rx_cl_check(struct aa_rx_cl *cl, size_t n_tf, const double *TF, size_t ldTF, struct aa_rx_cl_set *cl_set)
Detect collisions.
AA_API void aa_rx_cl_set_fill(struct aa_rx_cl_set *dst, const struct aa_rx_cl_set *src)
Fill dst with all true entries in src.