amino  1.0-beta2
Lightweight Robot Utility Library
scene_collision.h File Reference

Collision checking. More...

#include "scene_fk.h"

Go to the source code of this file.

Functions

AA_API void aa_rx_cl_init ()
 Initialize collision handling.
 
AA_API struct aa_rx_cl_set * aa_rx_cl_set_create (const struct aa_rx_sg *sg)
 Create a collision set.
 
AA_API void aa_rx_cl_set_destroy (struct aa_rx_cl_set *cl_set)
 Destroy a collision set.
 
AA_API void aa_rx_cl_set_set (struct aa_rx_cl_set *cl_set, aa_rx_frame_id i, aa_rx_frame_id j, int is_colliding)
 Set the value of collision between frames i and j.
 
AA_API void aa_rx_cl_set_fill (struct aa_rx_cl_set *dst, const struct aa_rx_cl_set *src)
 Fill dst with all true entries in src. More...
 
AA_API int aa_rx_cl_set_get (const struct aa_rx_cl_set *cl_set, aa_rx_frame_id i, aa_rx_frame_id j)
 Return the value of collision between frames i and j.
 
AA_API void aa_rx_cl_set_merge (struct aa_rx_cl_set *into, const struct aa_rx_cl_set *from)
 Fill set ‘into’ with all elements in set ‘from’. More...
 
AA_API void aa_rx_cl_set_clear (struct aa_rx_cl_set *cl_set)
 Clear all collisions stored in the set.
 
AA_API void aa_rx_sg_cl_init (struct aa_rx_sg *scene_graph)
 Initialize the collision structures within scene_graph.
 
AA_API struct aa_rx_cl * aa_rx_cl_create (const struct aa_rx_sg *scene_graph)
 Create a new collision detection context for scene_graph.
 
AA_API void aa_rx_cl_destroy (struct aa_rx_cl *cl)
 Destroy a collision detection context.
 
AA_API void aa_rx_cl_allow (struct aa_rx_cl *cl, aa_rx_frame_id i, aa_rx_frame_id j, int allowed)
 Allow (ignore) collisions between frames i and j if allowed is true.
 
AA_API void aa_rx_cl_allow_set (struct aa_rx_cl *cl, const struct aa_rx_cl_set *set)
 Allow collisions between all frame pairs in set.
 
AA_API void aa_rx_cl_allow_name (struct aa_rx_cl *cl, const char *frame0, const char *frame1, int allowed)
 Allow (ignore) collisions between frames0 and frame1 if allowed is true.
 
AA_API int aa_rx_cl_check (struct aa_rx_cl *cl, size_t n_tf, const double *TF, size_t ldTF, struct aa_rx_cl_set *cl_set)
 Detect collisions. More...
 
AA_API int aa_rx_cl_check_fk (struct aa_rx_cl *cl, struct aa_rx_fk *fk, struct aa_rx_cl_set *cl_set)
 Detect collisions. More...
 
AA_API void aa_rx_sg_allow_config (struct aa_rx_sg *scene_graph, size_t n_q, const double *q)
 Allow all collisions at configuration q.
 
AA_API void aa_rx_sg_cl_set_copy (const struct aa_rx_sg *sg, struct aa_rx_cl_set *cl_set)
 Retrieve the set of allowed collisions.
 
AA_API void aa_rx_sg_get_collision (const struct aa_rx_sg *scene_graph, size_t n_q, const double *q, struct aa_rx_cl_set *cl_set)
 Check the collisions at q.
 
AA_API struct aa_rx_cl_dist * aa_rx_cl_dist_create (const struct aa_rx_cl *)
 Create a collision distance context.
 
AA_API void aa_rx_cl_dist_destroy (struct aa_rx_cl_dist *dist)
 Destroy a collision distance context.
 
AA_API int aa_rx_cl_dist_check (struct aa_rx_cl_dist *cl_dist, const struct aa_rx_fk *fk)
 Run a collision distance check.
 
AA_API double aa_rx_cl_dist_get_min_dist (const struct aa_rx_cl_dist *cl_dist, aa_rx_frame_id id0, aa_rx_frame_id *id1, double *points)
 Get the minimum separation distance.
 
AA_API double aa_rx_cl_dist_get_dist (const struct aa_rx_cl_dist *cl_dist, aa_rx_frame_id id0, aa_rx_frame_id id1)
 Get the separation distance between specified frames.
 
AA_API double aa_rx_cl_dist_get_points (const struct aa_rx_cl_dist *cl_dist, aa_rx_frame_id id0, aa_rx_frame_id id1, double point0[3], double point1[3])
 Get the closest points between specified frames.
 

Detailed Description

Collision checking.

Definition in file scene_collision.h.

Function Documentation

◆ aa_rx_cl_check()

AA_API int aa_rx_cl_check ( struct aa_rx_cl *  cl,
size_t  n_tf,
const double *  TF,
size_t  ldTF,
struct aa_rx_cl_set *  cl_set 
)

Detect collisions.

If cl_set is non-NULL, it will be filled in with all detected collisions. If cl_set is NULL, collision checking may short-circuit after the first collision is detected.

Returns
0 if no collisions are detected and non-zero if any collisions are detected.

◆ aa_rx_cl_check_fk()

AA_API int aa_rx_cl_check_fk ( struct aa_rx_cl *  cl,
struct aa_rx_fk *  fk,
struct aa_rx_cl_set *  cl_set 
)

Detect collisions.

If cl_set is non-NULL, it will be filled in with all detected collisions. If cl_set is NULL, collision checking may short-circuit after the first collision is detected.

Returns
0 if no collisions are detected and non-zero if any collisions are detected.

◆ aa_rx_cl_set_fill()

AA_API void aa_rx_cl_set_fill ( struct aa_rx_cl_set *  dst,
const struct aa_rx_cl_set *  src 
)

Fill dst with all true entries in src.

False entries in src have no effect corresponding entries in dst.

◆ aa_rx_cl_set_merge()

AA_API void aa_rx_cl_set_merge ( struct aa_rx_cl_set *  into,
const struct aa_rx_cl_set *  from 
)

Fill set ‘into’ with all elements in set ‘from’.

This is a union operation, with the result stored in ‘into’.