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 
47 /*--- Motion Planning ---*/
48 
52 struct aa_rx_mp;
53 
57 struct aa_rx_mp_planner;
58 
62 AA_API struct aa_rx_mp*
63 aa_rx_mp_create( const struct aa_rx_sg_sub *sub_sg );
64 
68 AA_API void
69 aa_rx_mp_destroy( struct aa_rx_mp *mp );
70 
78 AA_API void
79 aa_rx_mp_set_start( struct aa_rx_mp *mp,
80  size_t n_all,
81  double *q_all );
82 
83 
94 AA_API void
96  size_t n_all,
97  double *q_all );
104 AA_API void
106  aa_rx_frame_id id0, aa_rx_frame_id id1, int allowed );
107 
111 AA_API int
112 aa_rx_mp_set_goal( struct aa_rx_mp *mp,
113  size_t n_q,
114  double *q_subset);
115 
119 AA_API int
120 aa_rx_mp_set_wsgoal( struct aa_rx_mp *mp,
121  aa_rx_ik_fun *ik_fun,
122  void *ik_cx,
123  size_t n_e,
124  double *E, size_t ldE );
125 
126 
130 AA_API void
131 aa_rx_mp_set_simplify( struct aa_rx_mp *mp,
132  int simplify );
133 
148 AA_API int
149 aa_rx_mp_plan( struct aa_rx_mp *mp,
150  double timeout,
151  size_t *n_path,
152  double **p_path_all );
153 
154 AA_API struct aa_rx_cl_set* aa_rx_mp_get_allowed( const struct aa_rx_mp* mp);
155 
156 
157 /*---- RRT -----*/
158 
162 struct aa_rx_mp_rrt_attr;
163 
167 AA_API struct aa_rx_mp_rrt_attr*
169 
173 AA_API void
174 aa_rx_mp_rrt_attr_destroy(struct aa_rx_mp_rrt_attr*);
175 
176 
180 AA_API void
181 aa_rx_mp_rrt_attr_set_bidirectional( struct aa_rx_mp_rrt_attr* attrs,
182  int is_bidirectional );
183 
190 AA_API void
191 aa_rx_mp_set_rrt( struct aa_rx_mp* mp,
192  const struct aa_rx_mp_rrt_attr *attr );
193 
194 
195 /*---- SBL -----*/
196 
200 struct aa_rx_mp_sbl_attr;
201 
205 AA_API struct aa_rx_mp_sbl_attr*
207 
211 AA_API void
212 aa_rx_mp_sbl_attr_destroy(struct aa_rx_mp_sbl_attr*);
213 
220 AA_API void
221 aa_rx_mp_set_sbl( struct aa_rx_mp* mp,
222  const struct aa_rx_mp_sbl_attr *attr );
223 
224 
225 /*---- KPIECE -----*/
226 
230 struct aa_rx_mp_kpiece_attr;
231 
235 AA_API struct aa_rx_mp_kpiece_attr*
237 
241 AA_API void
242 aa_rx_mp_kpiece_attr_destroy(struct aa_rx_mp_kpiece_attr*);
243 
250 AA_API void
251 aa_rx_mp_set_kpiece( struct aa_rx_mp* mp,
252  const struct aa_rx_mp_kpiece_attr *attr );
253 
254 
255 
256 
257 #endif /*AMINO_RX_SCENE_PLANNING_H*/
int aa_rx_ik_fun(void *context, size_t n_tf, const double *TF, size_t ld_TF, size_t n_q, double *q)
General type for an IK solver function.
Definition: scene_kin.h:158
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:48
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 int aa_rx_mp_set_wsgoal(struct aa_rx_mp *mp, aa_rx_ik_fun *ik_fun, void *ik_cx, size_t n_e, double *E, size_t ldE)
Set the goal as workspace pose.
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 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:86
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.