amino  1.0-beta2
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 
49 AA_API void
50 aa_rx_cl_init( );
51 
57 struct aa_rx_cl_set;
58 
62 AA_API struct aa_rx_cl_set*
63 aa_rx_cl_set_create( const struct aa_rx_sg *sg );
64 
68 AA_API void
69 aa_rx_cl_set_destroy(struct aa_rx_cl_set *cl_set);
70 
74 AA_API void
75 aa_rx_cl_set_set( struct aa_rx_cl_set *cl_set,
78  int is_colliding );
79 
85 AA_API void
86 aa_rx_cl_set_fill( struct aa_rx_cl_set *dst,
87  const struct aa_rx_cl_set *src );
88 
92 AA_API int
93 aa_rx_cl_set_get( const struct aa_rx_cl_set *cl_set,
95  aa_rx_frame_id j );
96 
102 AA_API void
103 aa_rx_cl_set_merge(struct aa_rx_cl_set* into, const struct aa_rx_cl_set* from);
104 
105 
109 AA_API void
110 aa_rx_cl_set_clear(struct aa_rx_cl_set* cl_set );
111 
115 struct aa_rx_cl;
116 
120 AA_API void
121 aa_rx_sg_cl_init( struct aa_rx_sg *scene_graph );
122 
126 AA_API struct aa_rx_cl *
127 aa_rx_cl_create( const struct aa_rx_sg *scene_graph );
128 
132 AA_API void
133 aa_rx_cl_destroy( struct aa_rx_cl *cl );
134 
138 AA_API void
139 aa_rx_cl_allow( struct aa_rx_cl *cl,
140  aa_rx_frame_id i,
141  aa_rx_frame_id j,
142  int allowed );
143 
147 AA_API void
148 aa_rx_cl_allow_set( struct aa_rx_cl *cl,
149  const struct aa_rx_cl_set *set );
150 
154 AA_API void
155 aa_rx_cl_allow_name( struct aa_rx_cl *cl,
156  const char *frame0,
157  const char *frame1,
158  int allowed );
159 
168 AA_API int
169 aa_rx_cl_check( struct aa_rx_cl *cl,
170  size_t n_tf,
171  const double *TF, size_t ldTF,
172  struct aa_rx_cl_set *cl_set );
173 
177 AA_API void
178 aa_rx_sg_allow_config( struct aa_rx_sg* scene_graph, size_t n_q, const double* q);
179 
183 AA_API void
184 aa_rx_sg_cl_set_copy(const struct aa_rx_sg* sg, struct aa_rx_cl_set * cl_set);
185 
189 AA_API void
190 aa_rx_sg_get_collision(const struct aa_rx_sg* scene_graph, size_t n_q, const double* q, struct aa_rx_cl_set* cl_set);
191 
192 #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:49
AA_API void aa_rx_sg_get_collision(const struct aa_rx_sg *scene_graph, size_t n_q, const double *q, struct aa_rx_cl_set *cl_set)
Check the collisions at q.
AA_API void aa_rx_sg_cl_set_copy(const struct aa_rx_sg *sg, struct aa_rx_cl_set *cl_set)
Retrieve the set of allowed collisions.
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.
AA_API void aa_rx_cl_set_clear(struct aa_rx_cl_set *cl_set)
Clear all collisions stored in the set.
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.
AA_API void aa_rx_sg_allow_config(struct aa_rx_sg *scene_graph, size_t n_q, const double *q)
Allow all collisions at configuration q.
#define AA_API
calling and name mangling convention for functions
Definition: amino.h:95
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 void aa_rx_cl_set_merge(struct aa_rx_cl_set *into, const struct aa_rx_cl_set *from)
Fill set `into' with all elements in set `from'.
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.