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 
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 
108 struct aa_rx_cl;
109 
113 AA_API void
114 aa_rx_sg_cl_init( struct aa_rx_sg *scene_graph );
115 
119 AA_API struct aa_rx_cl *
120 aa_rx_cl_create( const struct aa_rx_sg *scene_graph );
121 
125 AA_API void
126 aa_rx_cl_destroy( struct aa_rx_cl *cl );
127 
131 AA_API void
132 aa_rx_cl_allow( struct aa_rx_cl *cl,
133  aa_rx_frame_id i,
134  aa_rx_frame_id j,
135  int allowed );
136 
140 AA_API void
141 aa_rx_cl_allow_set( struct aa_rx_cl *cl,
142  const struct aa_rx_cl_set *set );
143 
147 AA_API void
148 aa_rx_cl_allow_name( struct aa_rx_cl *cl,
149  const char *frame0,
150  const char *frame1,
151  int allowed );
152 
161 AA_API int
162 aa_rx_cl_check( struct aa_rx_cl *cl,
163  size_t n_tf,
164  const double *TF, size_t ldTF,
165  struct aa_rx_cl_set *cl_set );
166 
167 AA_API void
168 aa_rx_sg_allow_config( struct aa_rx_sg* scene_graph, const double* q);
169 
170 AA_API void
171 aa_rx_sg_cl_set_copy(const struct aa_rx_sg* sg, struct aa_rx_cl_set * cl_set);
172 
173 AA_API void
174 aa_rx_sg_get_collision(const struct aa_rx_sg* scene_graph, const double* q, struct aa_rx_cl_set* cl_set);
175 
176 #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_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: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.