amino  1.0-beta2
Lightweight Robot Utility Library
scene_planning.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_PLANNING_H
39 #define AMINO_RX_SCENE_PLANNING_H
40 
41 #include "scene_ik.h"
42 
48 /*--- Motion Planning ---*/
49 
53 struct aa_rx_mp;
54 
58 struct aa_rx_mp_planner;
59 
63 AA_API struct aa_rx_mp*
64 aa_rx_mp_create( const struct aa_rx_sg_sub *sub_sg );
65 
69 AA_API void
70 aa_rx_mp_destroy( struct aa_rx_mp *mp );
71 
79 AA_API void
80 aa_rx_mp_set_start( struct aa_rx_mp *mp,
81  size_t n_all,
82  double *q_all );
83 
84 
95 AA_API void
96 aa_rx_mp_allow_config( struct aa_rx_mp *mp,
97  size_t n_all,
98  double *q_all );
105 AA_API void
106 aa_rx_mp_allow_collision( struct aa_rx_mp *mp,
107  aa_rx_frame_id id0, aa_rx_frame_id id1, int allowed );
108 
112 AA_API int
113 aa_rx_mp_set_goal( struct aa_rx_mp *mp,
114  size_t n_q,
115  double *q_subset);
116 
120 AA_API int
121 aa_rx_mp_set_wsgoal( struct aa_rx_mp *mp,
122  size_t n_e, const aa_rx_frame_id *frames,
123  const double *E, size_t ldE );
124 
125 
129 AA_API void
130 aa_rx_mp_set_simplify( struct aa_rx_mp *mp,
131  int simplify );
132 
136 AA_API void
137 aa_rx_mp_set_track_collisions( struct aa_rx_mp *mp, int track );
138 
142 AA_API const struct aa_rx_cl_set *
143 aa_rx_mp_get_collisions( const struct aa_rx_mp *mp );
144 
159 AA_API int
160 aa_rx_mp_plan( struct aa_rx_mp *mp,
161  double timeout,
162  size_t *n_path,
163  double **p_path_all );
164 
169 AA_API struct aa_rx_cl_set* aa_rx_mp_get_allowed( const struct aa_rx_mp* mp);
170 
171 
172 /*---- RRT -----*/
173 
177 struct aa_rx_mp_rrt_attr;
178 
182 AA_API struct aa_rx_mp_rrt_attr*
184 
188 AA_API void
189 aa_rx_mp_rrt_attr_destroy(struct aa_rx_mp_rrt_attr*);
190 
191 
195 AA_API void
196 aa_rx_mp_rrt_attr_set_bidirectional( struct aa_rx_mp_rrt_attr* attrs,
197  int is_bidirectional );
198 
205 AA_API void
206 aa_rx_mp_set_rrt( struct aa_rx_mp* mp,
207  const struct aa_rx_mp_rrt_attr *attr );
208 
209 
210 /*---- SBL -----*/
211 
215 struct aa_rx_mp_sbl_attr;
216 
220 AA_API struct aa_rx_mp_sbl_attr*
222 
226 AA_API void
227 aa_rx_mp_sbl_attr_destroy(struct aa_rx_mp_sbl_attr*);
228 
235 AA_API void
236 aa_rx_mp_set_sbl( struct aa_rx_mp* mp,
237  const struct aa_rx_mp_sbl_attr *attr );
238 
239 
240 /*---- KPIECE -----*/
241 
245 struct aa_rx_mp_kpiece_attr;
246 
250 AA_API struct aa_rx_mp_kpiece_attr*
252 
256 AA_API void
257 aa_rx_mp_kpiece_attr_destroy(struct aa_rx_mp_kpiece_attr*);
258 
265 AA_API void
266 aa_rx_mp_set_kpiece( struct aa_rx_mp* mp,
267  const struct aa_rx_mp_kpiece_attr *attr );
268 
269 
270 
271 
272 #endif /*AMINO_RX_SCENE_PLANNING_H*/
#define AA_API
calling and name mangling convention for functions
Definition: amino.h:95
Inverse Position Kinematics.
AA_API struct aa_rx_mp_kpiece_attr * aa_rx_mp_kpiece_attr_create(void)
Create an KPIECE attribute struct.
AA_API void aa_rx_mp_set_rrt(struct aa_rx_mp *mp, const struct aa_rx_mp_rrt_attr *attr)
Use the RRT motion planning algorithm.
AA_API struct aa_rx_mp * aa_rx_mp_create(const struct aa_rx_sg_sub *sub_sg)
Create a new motion plannet context for the given sub-scenegraph.
AA_API void aa_rx_mp_allow_collision(struct aa_rx_mp *mp, aa_rx_frame_id id0, aa_rx_frame_id id1, int allowed)
Indicate whether collisions between the two given frames are allowed.
AA_API void aa_rx_mp_rrt_attr_destroy(struct aa_rx_mp_rrt_attr *)
Destroy an RRT attribute struct.
AA_API void aa_rx_mp_allow_config(struct aa_rx_mp *mp, size_t n_all, double *q_all)
Indicate a valid configuration for the motion planning context.
AA_API void aa_rx_mp_sbl_attr_destroy(struct aa_rx_mp_sbl_attr *)
Destroy an SBL attribute struct.
AA_API void aa_rx_mp_rrt_attr_set_bidirectional(struct aa_rx_mp_rrt_attr *attrs, int is_bidirectional)
Whether the RRT should be bidirectional.
AA_API const struct aa_rx_cl_set * aa_rx_mp_get_collisions(const struct aa_rx_mp *mp)
Get most recent collision data.
AA_API int aa_rx_mp_set_wsgoal(struct aa_rx_mp *mp, size_t n_e, const aa_rx_frame_id *frames, const double *E, size_t ldE)
Set the goal as workspace pose.
AA_API void aa_rx_mp_set_start(struct aa_rx_mp *mp, size_t n_all, double *q_all)
Set the motion planning start configuration.
AA_API void aa_rx_mp_set_sbl(struct aa_rx_mp *mp, const struct aa_rx_mp_sbl_attr *attr)
Use the SBL motion planning algorithm.
AA_API int aa_rx_mp_set_goal(struct aa_rx_mp *mp, size_t n_q, double *q_subset)
Set the goal as a joint-space configuration.
AA_API void aa_rx_mp_set_simplify(struct aa_rx_mp *mp, int simplify)
Set whether to simplify the planned path.
AA_API void aa_rx_mp_set_kpiece(struct aa_rx_mp *mp, const struct aa_rx_mp_kpiece_attr *attr)
Use the KPIECE motion planning algorithm.
AA_API int aa_rx_mp_plan(struct aa_rx_mp *mp, double timeout, size_t *n_path, double **p_path_all)
Execute the planner.
AA_API void aa_rx_mp_set_track_collisions(struct aa_rx_mp *mp, int track)
Set whether to track collisions.
AA_API struct aa_rx_cl_set * aa_rx_mp_get_allowed(const struct aa_rx_mp *mp)
Return a pointer to the allowed collision set for the motion planning context.
AA_API struct aa_rx_mp_sbl_attr * aa_rx_mp_sbl_attr_create(void)
Create an SBL attribute struct.
AA_API void aa_rx_mp_kpiece_attr_destroy(struct aa_rx_mp_kpiece_attr *)
Destroy an KPIECE attribute struct.
AA_API void aa_rx_mp_destroy(struct aa_rx_mp *mp)
Destroy a motion planning context.
AA_API struct aa_rx_mp_rrt_attr * aa_rx_mp_rrt_attr_create(void)
Create an RRT attribute struct.
signed long aa_rx_frame_id
Type for frame indices.
Definition: scenegraph.h:54