38 #ifndef AMINO_SCENEGRAPH_H
39 #define AMINO_SCENEGRAPH_H
59 #define AA_RX_FRAME_ROOT ((aa_rx_frame_id)-1)
61 #define AA_RX_FRAME_NONE ((aa_rx_frame_id)-2)
66 #define AA_RX_CONFIG_NONE ((aa_rx_config_id)-1)
67 #define AA_RX_CONFIG_MULTI ((aa_rx_config_id)-2)
143 const struct aa_rx_sg *scene_graph );
150 const struct aa_rx_sg *scene_graph );
168 const struct aa_rx_sg *scene_graph,
size_t n_names,
169 const char **names );
178 const struct aa_rx_sg *scene_graph,
const char *config_name);
188 const struct aa_rx_sg *scene_graph,
size_t n,
194 const struct aa_rx_sg *scene_graph,
size_t n_all,
size_t n_subset,
196 const double *config_all,
197 double *config_subset );
201 const struct aa_rx_sg *scene_graph,
size_t n_all,
size_t n_subset,
213 const struct aa_rx_sg *scene_graph,
const char *frame_name);
239 const char *parent,
const char *name,
240 const double q[4],
const double v[3] );
259 const char *parent,
const char *name,
260 const double q[4],
const double v[3],
261 const char *config_name,
262 const double axis[3],
double offset );
281 const char *parent,
const char *name,
282 const double q[4],
const double v[3],
283 const char *config_name,
284 const double axis[3],
double offset );
298 const char *config_name,
299 double min,
double max );
306 const char *config_name,
307 double min,
double max );
314 const char *config_name,
315 double min,
double max );
322 const char *config_name,
323 double min,
double max );
333 double *min,
double *max );
344 double *min,
double *max );
355 double *min,
double *max );
366 double *min,
double *max );
397 (
const struct aa_rx_sg *scene_graph,
398 size_t n_q,
const double *q,
400 double *TF_rel,
size_t ld_rel,
401 double *TF_abs,
size_t ld_abs );
403 AA_API void aa_rx_sg_tf_update
404 (
const struct aa_rx_sg *scene_graph,
409 const double *TF_rel0,
size_t ld_rel0,
410 const double *TF_abs0,
size_t ld_abs0,
411 double *TF_rel,
size_t ld_rel,
412 double *TF_abs,
size_t ld_abs );
446 const double * tf_abs,
448 double * from_tf_to);
450 AA_API void aa_rx_sg_reparent (
460 AA_API void aa_rx_sg_allow_collision_name(
struct aa_rx_sg *scene_graph,
const char* id0,
const char* id1,
const 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_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 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.
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_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.
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.
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 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
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_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 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_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.