amino
Lightweight Robot Utility Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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_kin.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 
147 AA_API int
148 aa_rx_mp_plan( struct aa_rx_mp *mp,
149  double timeout,
150  size_t *n_path,
151  double **p_path_all );
152 
153 AA_API struct aa_rx_cl_set* aa_rx_mp_get_allowed( const struct aa_rx_mp* mp);
154 
155 
156 /*---- RRT -----*/
157 
161 struct aa_rx_mp_rrt_attr;
162 
166 AA_API struct aa_rx_mp_rrt_attr*
168 
172 AA_API void
173 aa_rx_mp_rrt_attr_destroy(struct aa_rx_mp_rrt_attr*);
174 
175 
179 AA_API void
180 aa_rx_mp_rrt_attr_set_bidirectional( struct aa_rx_mp_rrt_attr* attrs,
181  int is_bidirectional );
182 
189 AA_API void
190 aa_rx_mp_set_rrt( struct aa_rx_mp* mp,
191  const struct aa_rx_mp_rrt_attr *attr );
192 
193 
194 /*---- SBL -----*/
195 
199 struct aa_rx_mp_sbl_attr;
200 
204 AA_API struct aa_rx_mp_sbl_attr*
206 
210 AA_API void
211 aa_rx_mp_sbl_attr_destroy(struct aa_rx_mp_sbl_attr*);
212 
219 AA_API void
220 aa_rx_mp_set_sbl( struct aa_rx_mp* mp,
221  const struct aa_rx_mp_sbl_attr *attr );
222 
223 
224 /*---- KPIECE -----*/
225 
229 struct aa_rx_mp_kpiece_attr;
230 
234 AA_API struct aa_rx_mp_kpiece_attr*
236 
240 AA_API void
241 aa_rx_mp_kpiece_attr_destroy(struct aa_rx_mp_kpiece_attr*);
242 
249 AA_API void
250 aa_rx_mp_set_kpiece( struct aa_rx_mp* mp,
251  const struct aa_rx_mp_kpiece_attr *attr );
252 
253 
254 
255 
256 #endif /*AMINO_RX_SCENE_PLANNING_H*/
AA_API struct aa_rx_mp_sbl_attr * aa_rx_mp_sbl_attr_create(void)
Create an SBL attribute struct.
AA_API struct aa_rx_mp_rrt_attr * aa_rx_mp_rrt_attr_create(void)
Create an RRT attribute struct.
AA_API void aa_rx_mp_sbl_attr_destroy(struct aa_rx_mp_sbl_attr *)
Destroy an SBL attribute struct.
signed long aa_rx_frame_id
Type for frame indices.
Definition: scenegraph.h:49
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_set_bidirectional(struct aa_rx_mp_rrt_attr *attrs, int is_bidirectional)
Whether the RRT should be bidirectional.
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_destroy(struct aa_rx_mp *mp)
Destroy a motion planning context.
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_rrt(struct aa_rx_mp *mp, const struct aa_rx_mp_rrt_attr *attr)
Use the RRT 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_sbl(struct aa_rx_mp *mp, const struct aa_rx_mp_sbl_attr *attr)
Use the SBL motion planning algorithm.
#define AA_API
calling and name mangling convention for functions
Definition: amino.h:95
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 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_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_kpiece_attr_destroy(struct aa_rx_mp_kpiece_attr *)
Destroy an KPIECE attribute struct.
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_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_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_allow_config(struct aa_rx_mp *mp, size_t n_all, double *q_all)
Indicate a valid configuration for the motion planning context.
Scenegraph kinematics.