38 #ifndef AMINO_SCENEGRAPH_H 39 #define AMINO_SCENEGRAPH_H 62 #define AA_RX_FRAME_ROOT ((aa_rx_frame_id)-1) 67 #define AA_RX_FRAME_NONE ((aa_rx_frame_id)-2) 72 #define AA_RX_CONFIG_NONE ((aa_rx_config_id)-1) 77 #define AA_RX_CONFIG_MULTI ((aa_rx_config_id)-2) 153 const struct aa_rx_sg *scene_graph );
160 const struct aa_rx_sg *scene_graph );
178 const struct aa_rx_sg *scene_graph,
size_t n_names,
179 const char **names );
188 const struct aa_rx_sg *scene_graph,
const char *config_name);
198 const struct aa_rx_sg *scene_graph,
size_t n,
207 const struct aa_rx_sg *scene_graph,
size_t n_all,
size_t n_subset,
209 const double *config_all,
210 double *config_subset );
217 const struct aa_rx_sg *scene_graph,
size_t n_all,
size_t n_subset,
230 const struct aa_rx_sg *scene_graph,
const char *frame_name);
256 const char *parent,
const char *name,
257 const double q[4],
const double v[3] );
277 const char *parent,
const char *name,
278 const double q[4],
const double v[3],
279 const char *config_name,
280 const double axis[3],
double offset );
300 const char *parent,
const char *name,
301 const double q[4],
const double v[3],
302 const char *config_name,
303 const double axis[3],
double offset );
317 const char *config_name,
318 double min,
double max );
325 const char *config_name,
326 double min,
double max );
333 const char *config_name,
334 double min,
double max );
341 const char *config_name,
342 double min,
double max );
354 double *min,
double *max );
367 double *min,
double *max );
380 double *min,
double *max );
391 double *min,
double *max );
405 size_t n,
double *q );
464 (
const struct aa_rx_sg *scene_graph,
465 size_t n_q,
const double *q,
467 double *TF_rel,
size_t ld_rel,
468 double *TF_abs,
size_t ld_abs );
490 aa_rx_sg_fill_tf_abs(
const struct aa_rx_sg *scene_graph,
513 (
const struct aa_rx_sg *scene_graph,
514 size_t n_q,
const double *q,
516 double *TF_rel,
size_t ld_rel,
517 double *TF_abs,
size_t ld_abs );
539 (
const struct aa_rx_sg *scene_graph,
540 size_t n_q,
const double *q,
542 double *TF_rel,
size_t ld_rel,
543 double *TF_abs,
size_t ld_abs );
574 (
const struct aa_rx_sg *scene_graph,
579 const double *TF_rel0,
size_t ld_rel0,
580 const double *TF_abs0,
size_t ld_abs0,
581 double *TF_rel,
size_t ld_rel,
582 double *TF_abs,
size_t ld_abs );
615 const double * tf_abs,
617 double * from_tf_to);
631 const char *new_parent,
652 const char* frame0,
const char* frame1,
int allowed );
AA_API int aa_rx_sg_get_limit_vel(const struct aa_rx_sg *scenegraph, aa_rx_config_id config_id, double *min, double *max)
Get velocity limit values.
AA_API void aa_rx_sg_duqu(const struct aa_rx_sg *scene_graph, size_t n_q, const double *q, size_t n_tf, double *TF_rel, size_t ld_rel, double *TF_abs, size_t ld_abs)
Compute transforms for the scene graph as dual quaternions.
AA_API void aa_rx_sg_reparent_id(const struct aa_rx_sg *scene_graph, aa_rx_frame_id new_parent, aa_rx_frame_id frame, const double *E1)
Change the parent of frame in the scenegraph.
AA_API void aa_rx_sg_config_indices(const struct aa_rx_sg *scene_graph, size_t n, const char **config_name, aa_rx_config_id *ids)
Return the indices of a configuration variable in the scene graph.
AA_API const double * aa_rx_sg_frame_axis(const struct aa_rx_sg *scene_graph, aa_rx_frame_id frame)
Return pointer to frame axis.
AA_API const char * aa_rx_sg_config_name(const struct aa_rx_sg *scene_graph, aa_rx_config_id config_id)
Return the config of the given frame.
AA_API void aa_rx_sg_set_limit_eff(struct aa_rx_sg *scenegraph, const char *config_name, double min, double max)
Set effort limit values.
AA_API aa_rx_config_id aa_rx_sg_config_id(const struct aa_rx_sg *scene_graph, const char *config_name)
Return the index of a configuration variable in the scene graph.
AA_API int aa_rx_sg_init(struct aa_rx_sg *scene_graph)
Setup the scenegraph internal indices.
AA_API const char * aa_rx_sg_frame_name(const struct aa_rx_sg *scene_graph, aa_rx_frame_id frame_id)
Return the name of the given frame.
Container for scene geometry.
signed long aa_rx_frame_id
Type for frame indices.
AA_API void aa_rx_sg_rm_frame(struct aa_rx_sg *scene_graph, const char *name)
Remove a frame.
AA_API aa_rx_frame_id aa_rx_sg_frame_id(const struct aa_rx_sg *scene_graph, const char *frame_name)
Return the index of a frame in the scene graph.
AA_API double * aa_rx_sg_alloc_config(const struct aa_rx_sg *sg, struct aa_mem_region *region)
Allocate storage for config array from region.
AA_API void aa_rx_sg_destroy(struct aa_rx_sg *scene_graph)
Destroy a scene graph.
AA_API enum aa_rx_frame_type aa_rx_sg_frame_type(const struct aa_rx_sg *scene_graph, aa_rx_frame_id frame_id)
Return the type of the given frame.
AA_API void aa_rx_sg_add_frame_fixed(struct aa_rx_sg *scene_graph, const char *parent, const char *name, const double q[4], const double v[3])
Add a fixed-transform frame to the scene graph.
A prismatic (sliding) transform.
AA_API void aa_rx_sg_tf(const struct aa_rx_sg *scene_graph, size_t n_q, const double *q, size_t n_tf, double *TF_rel, size_t ld_rel, double *TF_abs, size_t ld_abs)
Compute transforms for the scene graph as quaternion-translations.
AA_API aa_rx_frame_id aa_rx_sg_frame_parent(const struct aa_rx_sg *scene_graph, aa_rx_frame_id frame_id)
Return the parent id of the frame.
AA_API struct aa_dmat * aa_rx_sg_get_tf_abs(const struct aa_rx_sg *scene_graph, struct aa_mem_region *reg, const struct aa_dvec *q)
Allocate and compute absolute transforms for the scene graph.
Data Structure for Region-Based memory allocation.
AA_API void aa_rx_sg_reparent_name(const struct aa_rx_sg *scene_graph, const char *new_parent, const char *frame, const double *E1)
Change the parent of frame in the scenegraph.
AA_API void aa_rx_sg_center_configs(const struct aa_rx_sg *sg, size_t n, double *q)
Fill q with the centered positions of each configuration.
AA_API void aa_rx_sg_rel_tf(const struct aa_rx_sg *scene_graph, const aa_rx_frame_id frame_from, const aa_rx_frame_id frame_to, const double *tf_abs, size_t ld_abs, double *from_tf_to)
Get transform between two given frames.
AA_API void aa_rx_sg_tf_update(const struct aa_rx_sg *scene_graph, size_t n_q, const double *q0, const double *q, size_t n_tf, const double *TF_rel0, size_t ld_rel0, const double *TF_abs0, size_t ld_abs0, double *TF_rel, size_t ld_rel, double *TF_abs, size_t ld_abs)
Updated transforms efficiently when only some configurations change.
Opaque type for a scene_graph.
AA_API size_t aa_rx_sg_frame_count(const struct aa_rx_sg *scene_graph)
Return the number of frames in scene_graph.
AA_API void aa_rx_sg_add_frame_revolute(struct aa_rx_sg *scene_graph, const char *parent, const char *name, const double q[4], const double v[3], const char *config_name, const double axis[3], double offset)
Add a revolute-joint frame to the scene graph.
Block matrix descriptors and linear algebra operations.
AA_API void aa_rx_sg_config_get(const struct aa_rx_sg *scene_graph, size_t n_all, size_t n_subset, const aa_rx_config_id *ids, const double *config_all, double *config_subset)
Retrieve a subset of the configuration vector.
AA_API int aa_rx_sg_get_limit_pos(const struct aa_rx_sg *scenegraph, aa_rx_config_id config_id, double *min, double *max)
Get position limit values.
AA_API aa_rx_config_id aa_rx_sg_frame_config(const struct aa_rx_sg *scene_graph, aa_rx_frame_id frame)
Return the config id of frame.
AA_API void aa_rx_sg_allow_collision_name(struct aa_rx_sg *scene_graph, const char *frame0, const char *frame1, int allowed)
Set allowed collisions between frame0 and frame1.
AA_API int aa_rx_sg_get_limit_eff(const struct aa_rx_sg *scenegraph, aa_rx_config_id config_id, double *min, double *max)
Get effort limit values.
#define AA_API
calling and name mangling convention for functions
Scenegraph-related type declarations.
AA_API size_t aa_rx_sg_config_names(const struct aa_rx_sg *scene_graph, size_t n_names, const char **names)
Fill names with pointers to config names.
AA_API void aa_rx_sg_map_geom(const struct aa_rx_sg *scene_graph, void(*function)(void *context, aa_rx_frame_id frame_id, struct aa_rx_geom *geom), void *context)
Call function for every geometry object in the scene graph.
AA_API size_t aa_rx_sg_config_count(const struct aa_rx_sg *scene_graph)
Return the number of configuration variables in scene_graph.
AA_API void aa_rx_sg_set_limit_pos(struct aa_rx_sg *scenegraph, const char *config_name, double min, double max)
Set position limit values.
AA_API void aa_rx_sg_config_set(const struct aa_rx_sg *scene_graph, size_t n_all, size_t n_subset, const aa_rx_config_id *ids, const double *config_subset, double *config_all)
Fill a subset of the configuration vector.
Descriptor for a block matrix.
AA_API struct aa_rx_sg * aa_rx_sg_copy(const struct aa_rx_sg *orig)
Deeply copy a scenegraph.
AA_API double * aa_rx_sg_alloc_tf(const struct aa_rx_sg *sg, struct aa_mem_region *region)
Allocate storage for TF array from region.
AA_API void aa_rx_sg_add_frame_prismatic(struct aa_rx_sg *scene_graph, const char *parent, const char *name, const double q[4], const double v[3], const char *config_name, const double axis[3], double offset)
Add a prismatic-joint frame to the scene graph.
AA_API void aa_rx_sg_set_limit_acc(struct aa_rx_sg *scenegraph, const char *config_name, double min, double max)
Set acceleration limit values.
AA_API double aa_rx_sg_config_center(const struct aa_rx_sg *sg, aa_rx_config_id config_id)
Get the centered position of a configuration variable.
AA_API int aa_rx_sg_get_limit_acc(const struct aa_rx_sg *scenegraph, aa_rx_config_id config_id, double *min, double *max)
Get acceleration limit values.
signed long aa_rx_config_id
Type for configuration indices.
AA_API void aa_rx_sg_tfmat(const struct aa_rx_sg *scene_graph, size_t n_q, const double *q, size_t n_tf, double *TF_rel, size_t ld_rel, double *TF_abs, size_t ld_abs)
Compute transforms for the scene graph as matrices.
aa_rx_frame_type
Enum of frame types.
AA_API void aa_rx_sg_set_limit_vel(struct aa_rx_sg *scenegraph, const char *config_name, double min, double max)
Set velocity limit values.
AA_API struct aa_rx_sg * aa_rx_sg_create()
Construct a new, empty scene graph.
AA_API void aa_rx_sg_allow_collision(struct aa_rx_sg *scene_graph, aa_rx_frame_id id0, aa_rx_frame_id id1, int allowed)
Set allowed collisions between frames id0 and id1.