40 #ifndef AMINO_SCENEGRAPH_H
41 #define AMINO_SCENEGRAPH_H
64 #define AA_RX_FRAME_ROOT ((aa_rx_frame_id)-1)
70 #define AA_RX_FRAME_NONE ((aa_rx_frame_id)-2)
76 #define AA_RX_CONFIG_NONE ((aa_rx_config_id)-1)
82 #define AA_RX_CONFIG_MULTI ((aa_rx_config_id)-2)
159 const struct aa_rx_sg *scene_graph );
166 const struct aa_rx_sg *scene_graph );
184 const struct aa_rx_sg *scene_graph,
size_t n_names,
185 const char **names );
194 const struct aa_rx_sg *scene_graph,
const char *config_name);
204 const struct aa_rx_sg *scene_graph,
size_t n,
213 const struct aa_rx_sg *scene_graph,
size_t n_all,
size_t n_subset,
215 const double *config_all,
216 double *config_subset );
223 const struct aa_rx_sg *scene_graph,
size_t n_all,
size_t n_subset,
236 const struct aa_rx_sg *scene_graph,
const char *frame_name);
262 const char *parent,
const char *name,
263 const double q[4],
const double v[3] );
283 const char *parent,
const char *name,
284 const double q[4],
const double v[3],
285 const char *config_name,
286 const double axis[3],
double offset );
306 const char *parent,
const char *name,
307 const double q[4],
const double v[3],
308 const char *config_name,
309 const double axis[3],
double offset );
323 const char *config_name,
324 double min,
double max );
331 const char *config_name,
332 double min,
double max );
339 const char *config_name,
340 double min,
double max );
347 const char *config_name,
348 double min,
double max );
360 double *min,
double *max );
373 double *min,
double *max );
386 double *min,
double *max );
397 double *min,
double *max );
411 size_t n,
double *q );
470 (
const struct aa_rx_sg *scene_graph,
471 size_t n_q,
const double *q,
473 double *TF_rel,
size_t ld_rel,
474 double *TF_abs,
size_t ld_abs );
496 aa_rx_sg_fill_tf_abs(
const struct aa_rx_sg *scene_graph,
519 (
const struct aa_rx_sg *scene_graph,
520 size_t n_q,
const double *q,
522 double *TF_rel,
size_t ld_rel,
523 double *TF_abs,
size_t ld_abs );
545 (
const struct aa_rx_sg *scene_graph,
546 size_t n_q,
const double *q,
548 double *TF_rel,
size_t ld_rel,
549 double *TF_abs,
size_t ld_abs );
580 (
const struct aa_rx_sg *scene_graph,
585 const double *TF_rel0,
size_t ld_rel0,
586 const double *TF_abs0,
size_t ld_abs0,
587 double *TF_rel,
size_t ld_rel,
588 double *TF_abs,
size_t ld_abs );
621 const double * tf_abs,
623 double * from_tf_to);
637 const char *new_parent,
658 const char* frame0,
const char* frame1,
int allowed );
662 aa_rx_sg_copy_frame_geom(
struct aa_rx_sg *scene_graph,
663 const char* src_frame,
const char* dst_frame );
683 const char *parent,
const char *name,
#define AA_API
calling and name mangling convention for functions
#define AA_EXTERN
name mangling convention external symbols
Block matrix descriptors and linear algebra operations.
Scenegraph-related type declarations.
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 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.
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_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 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 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 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 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_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 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.
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 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 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.
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 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 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 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 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 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.
AA_API void aa_rx_sg_rm_frame(struct aa_rx_sg *scene_graph, const char *name)
Remove a frame.
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 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 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 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 struct aa_rx_sg * aa_rx_sg_copy(const struct aa_rx_sg *orig)
Deeply copy a scenegraph.
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 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 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 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 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.
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 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_API struct aa_rx_sg * aa_rx_sg_create()
Construct a new, empty scene graph.
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 int aa_rx_sg_init(struct aa_rx_sg *scene_graph)
Setup the scenegraph internal indices.
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.
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_center_configs(const struct aa_rx_sg *sg, size_t n, double *q)
Fill q with the centered positions of each configuration.
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.
AA_API void aa_rx_sg_destroy(struct aa_rx_sg *scene_graph)
Destroy a scene graph.
aa_rx_frame_type
Enum of frame types.
@ AA_RX_FRAME_PRISMATIC
A prismatic (sliding) transform.
@ AA_RX_FRAME_REVOLUTE
A rotating transform.
@ AA_RX_FRAME_FIXED
A fixed transform.
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 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_set_limit_acc(struct aa_rx_sg *scenegraph, const char *config_name, double min, double max)
Set acceleration 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.
signed long aa_rx_frame_id
Type for frame indices.
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.
Descriptor for a block matrix.
Data Structure for Region-Based memory allocation.
Opaque structure for geometry options.
Container for scene geometry.
Opaque type for a scene_graph.