libmove3d  3.13.0
Defines | Functions | Variables
/home/slemaign/softs-local/BioMove3D-git/p3d/p3d_joints.c File Reference

Joint function API. More...

#include "P3d-pkg.h"
#include "Util-pkg.h"
#include "Planner-pkg.h"

Defines

#define DOF_MAX_SIZE_NAME   (JNT_MAX_SIZE_NAME+6)
 Maximal size for the name of a joint and its degree of freedom.

Functions

p3d_jntp3d_robot_dof_to_jnt (p3d_rob *robotPt, int i_robot, int *i_joint)
 Get the joint that hold the value of a degree of freedom for a given robot, return the index of this value in this joint.
int p3d_robot_user_dof_to_dof (p3d_rob *robotPt, int i_user_dof)
 Get the index of the user degree of freedom in the real configuration.
int p3d_jnt_get_dof_is_angular (p3d_type_joint type, int i_dof)
 Get the type of the degree of freedom for a given type of joint (angular or not)
int p3d_jnt_is_dof_angular (p3d_jnt *jntPt, int i_dof)
 Get the type of the degree of freedom for a given joint (angular or not)
int p3d_jnt_is_dof_linear (p3d_jnt *jntPt, int i_dof)
 Get the type of the degree of freedom for a given joint (linear or not)
int p3d_jnt_compute_is_dof_circular (p3d_jnt *jntPt, int i_dof)
 Get the type of the degree of freedom for a given joint (circular or not)
const char * p3d_jnt_get_dof_name (p3d_jnt *jntPt, int i_dof)
 Get the name of a degree of freedom for a given joint.
const char * p3d_jnt_get_only_dof_name (p3d_type_joint type, int i_dof)
 Get the name for a given a degree of freedom.
void p3d_jnt_set_name (p3d_jnt *jntPt, const char *name)
 Set the name of the joint.
double p3d_jnt_get_dof (p3d_jnt *jntPt, int i_dof)
 Get the value of a degree of freedom for the given joint.
double p3d_jnt_get_dof_deg (p3d_jnt *jntPt, int i_dof)
 Get the value of a degree of freedom for the given joint.
int p3d_jnt_get_dof_is_user (p3d_jnt *jntPt, int i_dof)
 Get the flag of user value.
int p3d_jnt_get_dof_is_active_for_planner (p3d_jnt *jntPt, int i_dof)
 Get the flag is_active_for_planner.
int p3d_jnt_get_dof_is_modified (p3d_jnt *jntPt, int i_dof)
 Get whether or not the degree of freedom as been modified.
double p3d_jnt_get_dof_v0 (p3d_jnt *jntPt, int i_dof)
 Get the value v0 for a degree of freedom in the given joint.
double p3d_jnt_get_dof_v0_deg (p3d_jnt *jntPt, int i_dof)
 Get the value v0 for a degree of freedom in the given joint.
void p3d_jnt_get_dof_axis (p3d_jnt *jntPt, int i_dof, p3d_vector3 axe)
 Get the initial axis for a degree of freedom in the given joint.
void p3d_jnt_get_dof_cur_axis (p3d_jnt *jntPt, int i_dof, p3d_vector3 axe)
 Get the current axis for a degree of freedom in the given joint.
void p3d_jnt_get_dof_cur_axis_before (p3d_jnt *jntPt, int i_dof, p3d_vector3 axe)
 Get the current axis for a degree of freedom in the given joint before the apply of jnt::jnt_mat.
void p3d_jnt_get_dof_bounds (p3d_jnt *jntPt, int i_dof, double *vmin, double *vmax)
 Get the value of the bounds for a given joint and degree of freedom.
void p3d_jnt_get_dof_bounds_deg (p3d_jnt *jntPt, int i_dof, double *vmin, double *vmax)
 Get the value of the bounds for a given joint and degree of freedom.
void p3d_jnt_get_dof_rand_bounds (p3d_jnt *jntPt, int i_dof, double *vmin, double *vmax)
 Get the value of the bounds for random shoot for a given joint and degree of freedom.
void p3d_jnt_get_dof_rand_bounds_deg (p3d_jnt *jntPt, int i_dof, double *vmin, double *vmax)
 Get the value of the bounds for random shoot for a given joint and degree of freedom.
void p3d_jnt_get_point (p3d_jnt *jntPt, p3d_point *pointPt)
 Get the position initial of the joint.
void p3d_jnt_get_vect_point (p3d_jnt *jntPt, p3d_vector3 pos)
 Get the position initial of the joint.
void p3d_jnt_get_cur_vect_point (p3d_jnt *jntPt, p3d_vector3 pos)
 Get the current absolut position of the joint.
void p3d_jnt_get_cur_vect_point_before (p3d_jnt *jntPt, p3d_vector3 pos)
 Get the current absolut position of the joint before the apply of jnt::jnt_mat.
int p3d_jnt_is_with_object (p3d_jnt *jntPt)
 Indicate whether or not there is an object on the joint.
void p3d_jnt_set_dof (p3d_jnt *jntPt, int i_dof, double val)
 Change the value of a degree of freedom for the given joint.
void p3d_jnt_set_dof_deg (p3d_jnt *jntPt, int i_dof, double val)
 Change the value of a degree of freedom for the given joint.
void p3d_jnt_set_dof_is_user (p3d_jnt *jntPt, int i_dof, int flag)
 Set the flag of user value.
void p3d_jnt_set_dof_is_active_for_planner (p3d_jnt *jntPt, int i_dof, int flag)
 Set the flag is_active_for_planner.
void p3d_jnt_set_is_user (p3d_jnt *jntPt, int flag)
 Set the flag of user value for all degree of freedom of the joint.
int p3d_jnt_get_is_active_for_planner (p3d_jnt *jntPt)
 Returns FALSE if at least one of the dofs is passive for the planner.
void p3d_jnt_set_is_active_for_planner (p3d_jnt *jntPt, int flag)
 Set the flag is_active_for_planner for all degree of freedom of the joint.
void p3d_jnt_set_is_active_for_planner2 (p3d_jnt *jnt, int flag)
 Desactive a joint for the planner with its dof.
void p3d_jnt_set_dof_is_modified (p3d_jnt *jntPt, int i_dof, int val)
 Set whether or not the degree of freedom as been modified.
void p3d_jnt_force_update (p3d_jnt *jntPt)
 Force the joint to be updated the next time.
void p3d_jnt_set_dof_v0 (p3d_jnt *jntPt, int i_dof, double val)
 Change the value of v0 for a degree of freedom in the given joint.
void p3d_jnt_set_dof_v0_deg (p3d_jnt *jntPt, int i_dof, double val)
 Change the value of v0 for a degree of freedom in the given joint.
void p3d_jnt_set_dof_bounds (p3d_jnt *jntPt, int i_dof, double vmin, double vmax)
 Change the value of the bounds for a given joint and degree of freedom.
void p3d_jnt_set_dof_bounds_deg (p3d_jnt *jntPt, int i_dof, double vmin, double vmax)
 Change the value of the bounds for a given joint and degree of freedom.
void p3d_jnt_set_dof_rand_bounds (p3d_jnt *jntPt, int i_dof, double vmin, double vmax)
 Change the value of the random bounds for a given joint and degree of freedom.
void p3d_jnt_set_dof_rand_bounds_deg (p3d_jnt *jntPt, int i_dof, double vmin, double vmax)
 Change the value of the random bounds for a given joint and degree of freedom.
void p3d_jnt_update_rel_pos_object (p3d_jnt *jntPt, p3d_obj *objPt)
 Change the object attached to a joint.
int p3d_jnt_set_object (p3d_jnt *jntPt, p3d_obj *objPt)
 Change the object attached to a joint.
void p3d_jnt_stay_within_dist (p3d_stay_within_dist_data *prev_data, p3d_jnt *jntPt, p3d_stay_within_dist_data *data, double *distance, configPt q_init, configPt q_max_param, double max_param, double *reach_param)
 Compute the distance and the speed that the joint could reach.
double p3d_GetWeightRotations (void)
void p3d_SetWeightRotations (double RotationWeight)
double p3d_jnt_calc_dof_dist (p3d_jnt *jntPt, int i_dof, configPt q_init, configPt q_end)
 Compute the distance between two configurations for a joint.
double p3d_jnt_calc_dof_dist_2 (p3d_jnt *jntPt, int i_dof, configPt q_init, configPt q_end)
double p3d_jnt_calc_dof_value (p3d_jnt *jntPt, int i_dof, configPt q_init, configPt q_end, double alpha)
 Compute the value of a joint in a linear methode between two configurations.
void p3d_jnt_calc_jnt_mat (p3d_jnt *jntPt)
 Compute the transformation matrix of the joint.
int p3d_jnt_calc_mat_pos (p3d_link_between_joint *link_jntPt)
 Compute the absolute position matrix of the joint.
void p3d_jnt_set_mat_pos (p3d_jnt *jntPt, p3d_matrix4 *abs_pos)
 Set the absolute position of a joint.
int p3d_jnt_calc_mat_pos_and_jac (p3d_link_between_joint *link_jntPt)
 Compute the absolute position matrix of the joint.
void p3d_jnt_set_mat_pos_and_jac (p3d_jnt *jntPt, p3d_matrix4 *abs_pos)
 Set the absolute position of a joint.
void p3d_jnt_clean_update (p3d_jnt *jntPt)
 Clean up the flags used to check if the joint is updated.
p3d_jntp3d_jnt_create_common (p3d_matrix4 pos)
 Create a new joint partialy defined.
p3d_jntp3d_jnt_create (p3d_type_joint type, p3d_matrix4 pos, double *v, double *vmin, double *vmax, double *vmin_rand, double *velocity_max, double *acceleration_max, double *jerk_max, double *torque_max, double *vmax_rand, double *param)
 Create a new joint with angles in radian.
p3d_jntp3d_jnt_create_deg (int type, p3d_matrix4 pos, double *v, double *vmin, double *vmax, double *vmin_rand, double *vmax_rand, double *velocity_max, double *acceleration_max, double *jerk_max, double *torque_max, double *param)
 Create a new joint with angles in degree.
void p3d_jnt_get_nb_param (p3d_type_joint type, int *nb_dof, int *nb_param)
 Get the number of degree of freedom, and the number of parameters needed to create a joint.
void p3d_jnt_scale (p3d_jnt *jntPt, double scale)
 Change the scale factor of a joint.
void p3d_jnt_change_pos0 (p3d_jnt *jntPt, p3d_matrix4 pos0)
 Change the initial position of a joint.
void p3d_jnt_attach_to_jnt (p3d_jnt *jnt_prevPt, p3d_jnt *jntPt)
 Attach a joint to an other.
void p3d_jnt_attachment (p3d_jnt *jnt1Pt, p3d_jnt *jnt2Pt, p3d_matrix4 rel_pos, int flag_prev)
 Attach a joint to an other but store the data only in the first joint.
void p3d_jnt_deattach_jnt (p3d_jnt *jntPt1, p3d_jnt *jntPt2)
 Deattach a joint to an other.
void p3d_jnt_destroy (p3d_jnt *jntPt)
 Destroy a joint.
int p3d_jnt_object_after_joint (p3d_jnt *jntPt)
 Indicate whether or not there is an object on or after the joint.
void p3d_jnt_stay_within_sphere (p3d_stay_within_dist_data *prev_data, p3d_jnt *jntPt, p3d_stay_within_dist_data *data, double *distance, double *reach_param)
 Compute the distance and the speed that the joint could reach for a fixed sphere.
double p3d_jnt_compute_max_distance_body_vertex (p3d_obj *body)
 Compute the maximal distance between the point joint is attached to and the points of the given body.

Variables

double WEIGHT_ROTATIONS = 1.

Detailed Description

Joint function API.

The joints are kinematics articulations between two obstacles. Into Move3D, it is possible to have virtual object (none object or pur graphic object). This allow the composition of sevral joint by the user to build specefic joints.

Each joint (p3d_jnt) could have sevral degree of freedom to control the relative position of robot's bodies.

This file is the standard function interface for complex joints. For specfific functions on joints, it switches to specific functions in file p3d_jnt_*.c. Presently there are 5 type of joints:


Function Documentation

double p3d_GetWeightRotations ( void  )

p3d_GetWeightRotations() Get the value of the weight given to the rotations for distance computations. The total weight of rotations is given by WeightRota*jntPt->dist

Returns:
: the value of the weight given to the rotations
void p3d_jnt_attach_to_jnt ( p3d_jnt jnt_prevPt,
p3d_jnt jntPt 
)

Attach a joint to an other.

Parameters:
prev_jntPt,:the previous joint
jntPt,:the joint
Note:
Update the next joint array of the other joint.
Create a link_between_joint.
void p3d_jnt_attachment ( p3d_jnt jnt1Pt,
p3d_jnt jnt2Pt,
p3d_matrix4  rel_pos,
int  flag_prev 
)

Attach a joint to an other but store the data only in the first joint.

Parameters:
jnt1Pt,:the joint that store the link
jnt2Pt,:the joint which is attached to jnt1Pt
rel_pos,:the relative position between the previous and the next joint
flag_prev,:TRUE if jnt2Pt is before jnt1Pt.
Note:
Create a link_between_joint.
double p3d_jnt_calc_dof_dist ( p3d_jnt jntPt,
int  i_dof,
configPt  q_init,
configPt  q_end 
)

Compute the distance between two configurations for a joint.

Note:

  • The joint looks directly in the robot configurations the degree of freedom that it needs.
  • This function test if the degree of freedom is angular. In this case it multiply it by jnt::dist to compare this distance with translation distances.
  • This function test also if the degree of freedom is circular to give the shortest distance.
  • The weight between rotations and translations is given by WeightRota*jntPt->dist
Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
qinit,:the initial robot configuration
q_end,:the final robot configuration
Returns:
the distance between q_init and q_end for the degree of freedom
double p3d_jnt_calc_dof_value ( p3d_jnt jntPt,
int  i_dof,
configPt  q_init,
configPt  q_end,
double  alpha 
)

Compute the value of a joint in a linear methode between two configurations.

Note:

  • The joint looks directly in the robot configurations the degree of freedom that it needs.
  • This function test also if the degree of freedom is circular to give the shortest distance.
Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
qinit,:the initial robot configuration
q_end,:the final robot configuration
alpha,:the parameter between 0 and 1.
Returns:
the value of the degree of freedom
void p3d_jnt_calc_jnt_mat ( p3d_jnt jntPt)

Compute the transformation matrix of the joint.

Parameters:
jntPt,:the joint.

This function use the value for the degree of freedom set in the joint by p3d_jnt_set_dof().

int p3d_jnt_calc_mat_pos ( p3d_link_between_joint link_jntPt)

Compute the absolute position matrix of the joint.

Parameters:
link_jntPt,:the link between two joints.
Returns:
FALSE if both joint are already updated, TRUE in other case.

This function use the value for the degree of freedom set in the joint by p3d_jnt_set_dof(). This function is able to follow the kinematic chain or to compute the inverse model.

Note:
It checks if the joints need an update.
int p3d_jnt_calc_mat_pos_and_jac ( p3d_link_between_joint link_jntPt)

Compute the absolute position matrix of the joint.

Parameters:
link_jntPt,:the link between two joints.
Returns:
FALSE if both joint are already updated, TRUE in other case.

This function use the value for the degree of freedom set in the joint by p3d_jnt_set_dof(). This function is able to follow the kinematic chain or to compute the inverse model.

Note:
It checks if the joints need an update.
void p3d_jnt_change_pos0 ( p3d_jnt jntPt,
p3d_matrix4  pos0 
)

Change the initial position of a joint.

Parameters:
jntPt,:the joint
pos0,:the initial position matrix.
Note:
Update the matrice in the links owned by the joint.
Does not update the matrice of relative position with the object (but not the absolute position).
void p3d_jnt_clean_update ( p3d_jnt jntPt)

Clean up the flags used to check if the joint is updated.

Parameters:
jntPt,:the joint.
Warning:
The joint must be updated before.
int p3d_jnt_compute_is_dof_circular ( p3d_jnt jntPt,
int  i_dof 
)

Get the type of the degree of freedom for a given joint (circular or not)

This calified joint when their bounds are linked together, when, for a rotation, the joint could freely turn. In this case, the computation of the value of the joint must check what is the sens of rotation that gives the shortest path.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Returns:
TRUE if circular, FALSE if not.
double p3d_jnt_compute_max_distance_body_vertex ( p3d_obj body)

Compute the maximal distance between the point joint is attached to and the points of the given body.

Parameters:
body,:the body
Return values:
themaximal distance
p3d_jnt* p3d_jnt_create ( p3d_type_joint  type,
p3d_matrix4  pos,
double *  v,
double *  vmin,
double *  vmax,
double *  vmin_rand,
double *  velocity_max,
double *  acceleration_max,
double *  jerk_max,
double *  torque_max,
double *  vmax_rand,
double *  param 
)

Create a new joint with angles in radian.

Parameters:
type,:the type of the joint
pos,:the position matrix of the joint
v,:the values of the degree of freedom for the joint
vmin& vmax: the bounds values of the degree of freedom for the joint
vmin_rand& vmax_rand: the random (or user) bounds values of the degree of freedom for the joint
velocity_max& torque_max: the maximal values of joint velocity and torque of the joint: only for P3D_ROTATE
param,:the array of the parameters for the joint
Returns:
the new joint.
p3d_jnt* p3d_jnt_create_common ( p3d_matrix4  pos)

Create a new joint partialy defined.

This function create and initialize the structure common to all joints. It is used in the funtion that creates joints, but must be not used otherwhere.

Parameters:
type,:the type of the joint
pos,:the position matrix of the joint
Returns:
the new joint.
p3d_jnt* p3d_jnt_create_deg ( int  type,
p3d_matrix4  pos,
double *  v,
double *  vmin,
double *  vmax,
double *  vmin_rand,
double *  vmax_rand,
double *  velocity_max,
double *  acceleration_max,
double *  jerk_max,
double *  torque_max,
double *  param 
)

Create a new joint with angles in degree.

Parameters:
type,:the type of the joint
pos,:the position matrix of the joint
v,:the values of the degree of freedom for the joint
vmin& vmax: the bounds values of the degree of freedom for the joint
vmin_rand& vmax_rand: the random (or user) bounds values of the degree of freedom for the joint
velocity_max& torque_max: the maximal values of joint velocity and torque of the joint: only for P3D_ROTATE
param,:the array of the parameters for the joint
Returns:
the new joint.
void p3d_jnt_deattach_jnt ( p3d_jnt jntPt1,
p3d_jnt jntPt2 
)

Deattach a joint to an other.

Parameters:
jntPt1,:the first joint
jntPt2,:the second joint
Note:
The order between jntPt1 and jntPt is not important.
Destroy a link_between_joint only if it is owned by one of the joints.
void p3d_jnt_destroy ( p3d_jnt jntPt)

Destroy a joint.

Parameters:
jntPt,:the joint.
Note:
Release the memory and destroy all the links with this joint.
Warning:
Do not change the robot structure.
void p3d_jnt_force_update ( p3d_jnt jntPt)

Force the joint to be updated the next time.

Parameters:
jntPt,:the joint
void p3d_jnt_get_cur_vect_point ( p3d_jnt jntPt,
p3d_vector3  pos 
)

Get the current absolut position of the joint.

Parameters:
jntPt,:the joint
Return values:
pos,:The position of the joint
void p3d_jnt_get_cur_vect_point_before ( p3d_jnt jntPt,
p3d_vector3  pos 
)

Get the current absolut position of the joint before the apply of jnt::jnt_mat.

Parameters:
jntPt,:the joint
Return values:
pos,:The position of the joint
double p3d_jnt_get_dof ( p3d_jnt jntPt,
int  i_dof 
)

Get the value of a degree of freedom for the given joint.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Returns:
The value of the degree of freedom (expressed in radian for angles)
void p3d_jnt_get_dof_axis ( p3d_jnt jntPt,
int  i_dof,
p3d_vector3  axe 
)

Get the initial axis for a degree of freedom in the given joint.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Return values:
axe,:The axe of the degree of freedom in the given joint.
void p3d_jnt_get_dof_bounds ( p3d_jnt jntPt,
int  i_dof,
double *  vmin,
double *  vmax 
)

Get the value of the bounds for a given joint and degree of freedom.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Return values:
vmin,:The minimum value of the degree of freedom (expressed in radian for angles)
vmax,:The maximum value of the degree of freedom (expressed in radian for angles)
void p3d_jnt_get_dof_bounds_deg ( p3d_jnt jntPt,
int  i_dof,
double *  vmin,
double *  vmax 
)

Get the value of the bounds for a given joint and degree of freedom.

Same function than p3d_jnt_get_dof_bounds(), but return degree for angles.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Return values:
vmin,:The minimum value of the degree of freedom (expressed in degree for angles)
vmax,:The maximum value of the degree of freedom (expressed in degree for angles)
void p3d_jnt_get_dof_cur_axis ( p3d_jnt jntPt,
int  i_dof,
p3d_vector3  axe 
)

Get the current axis for a degree of freedom in the given joint.

Get the current normalized axis of the degree of freedom for jntPt.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Return values:
axe,:The axe of the degree of freedom in the given joint.
void p3d_jnt_get_dof_cur_axis_before ( p3d_jnt jntPt,
int  i_dof,
p3d_vector3  axe 
)

Get the current axis for a degree of freedom in the given joint before the apply of jnt::jnt_mat.

Get the current normalized axis of the degree of freedom for jntPt before the apply of jnt::jnt_mat.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Return values:
axe,:The axe of the degree of freedom in the given joint.
double p3d_jnt_get_dof_deg ( p3d_jnt jntPt,
int  i_dof 
)

Get the value of a degree of freedom for the given joint.

Same function than p3d_jnt_get_dof(), but return degree for angles.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Returns:
The value of the degree of freedom (expressed in degree for angles)
int p3d_jnt_get_dof_is_active_for_planner ( p3d_jnt jntPt,
int  i_dof 
)

Get the flag is_active_for_planner.

Note: This flag maybe redundant with the flag "is_user".

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Returns:
The status of the degree of freedom (planner controled (::TRUE) or not (::FALSE))
int p3d_jnt_get_dof_is_angular ( p3d_type_joint  type,
int  i_dof 
)

Get the type of the degree of freedom for a given type of joint (angular or not)

This function is used to know if the degree of freedom is angular (in radian between $ -\pi $ and $ \pi $ or between $ 0 $ and $ 2.\pi $, so the value doesn't depend of the environment), or if it's not (so its bounds depend of the scale factor and of the joint description). Then, to compare angular dof and not angular dof we must multiply angular dof by a distance (classicaly jnt::dist)

Parameters:
type,:the type of joint
i_dof,:the index of the degree of freedom
Returns:
TRUE angular, FALSE not angular
int p3d_jnt_get_dof_is_modified ( p3d_jnt jntPt,
int  i_dof 
)

Get whether or not the degree of freedom as been modified.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Returns:
The status of the degree of freedom (modified (::TRUE) or not (::FALSE))
Note:
A call to p3d_jnt_set_dof() can modify the degree of freedom. A call to p3d_jnt_clean_update() uncheck the change.
int p3d_jnt_get_dof_is_user ( p3d_jnt jntPt,
int  i_dof 
)

Get the flag of user value.

Note: If it isn't controled by user, then it isn't controled by p3d_shoot. This flag could be used for placement joint, passif joint or degree of freedom computed by local method. A degree of freedom not controled by user does not appeared in user config.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Returns:
The status of the degree of freedom (user controled (::TRUE) or not (::FALSE))
const char* p3d_jnt_get_dof_name ( p3d_jnt jntPt,
int  i_dof 
)

Get the name of a degree of freedom for a given joint.

This function is used for printing purpose.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Returns:
The name of the degree of freedom
void p3d_jnt_get_dof_rand_bounds ( p3d_jnt jntPt,
int  i_dof,
double *  vmin,
double *  vmax 
)

Get the value of the bounds for random shoot for a given joint and degree of freedom.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Return values:
vmin,:The minimum value for random on the degree of freedom (expressed in radian for angles)
vmax,:The maximum value for random on the degree of freedom (expressed in radian for angles)
void p3d_jnt_get_dof_rand_bounds_deg ( p3d_jnt jntPt,
int  i_dof,
double *  vmin,
double *  vmax 
)

Get the value of the bounds for random shoot for a given joint and degree of freedom.

Same function than p3d_jnt_get_dof_rand_bounds(), but return degree for angles.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Return values:
vmin,:The minimum value for random of the degree of freedom (expressed in degree for angles)
vmax,:The maximum value for random of the degree of freedom (expressed in degree for angles)
double p3d_jnt_get_dof_v0 ( p3d_jnt jntPt,
int  i_dof 
)

Get the value v0 for a degree of freedom in the given joint.

Note: This function is used in the sdk.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Returns:
The value of the degree of freedom (expressed in radian for angles)
double p3d_jnt_get_dof_v0_deg ( p3d_jnt jntPt,
int  i_dof 
)

Get the value v0 for a degree of freedom in the given joint.

Same function than p3d_jnt_get_dof(), but return degree for angles.

Note: This function is used in the sdk.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Returns:
The value of the degree of freedom (expressed in degree for angles)
int p3d_jnt_get_is_active_for_planner ( p3d_jnt jntPt)

Returns FALSE if at least one of the dofs is passive for the planner.

Note: This flag maybe redundant with the flag "is_user".

Parameters:
jntPt,:the joint
void p3d_jnt_get_nb_param ( p3d_type_joint  type,
int *  nb_dof,
int *  nb_param 
)

Get the number of degree of freedom, and the number of parameters needed to create a joint.

Parameters:
type,:the type of the joint (::p3d_type_joint),
Return values:
nb_dof,:the number of degree of freedom.
nb_param,:the number of parameters.
const char* p3d_jnt_get_only_dof_name ( p3d_type_joint  type,
int  i_dof 
)

Get the name for a given a degree of freedom.

This function is used for printing purpose.

Parameters:
type,:the joint type
i_dof,:the index of the degree of freedom
Returns:
The name of the degree of freedom
void p3d_jnt_get_point ( p3d_jnt jntPt,
p3d_point pointPt 
)

Get the position initial of the joint.

Parameters:
jntPt,:the joint
Return values:
pointPt,:The position of the joint
void p3d_jnt_get_vect_point ( p3d_jnt jntPt,
p3d_vector3  pos 
)

Get the position initial of the joint.

Parameters:
jntPt,:the joint
Return values:
pos,:The position of the joint
int p3d_jnt_is_dof_angular ( p3d_jnt jntPt,
int  i_dof 
)

Get the type of the degree of freedom for a given joint (angular or not)

This function is used to know if the degree of freedom is angular (in radian between $ -\pi $ and $ \pi $ or between $ 0 $ and $ 2.\pi $, so the value doesn't depend of the environment), or if it's not (so its bounds depend of the scale factor and of the joint description). Then, to compare angular dof and not angular dof we must multiply angular dof by a distance (classicaly jnt::dist)

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Returns:
TRUE angular, FALSE not angular
int p3d_jnt_is_dof_linear ( p3d_jnt jntPt,
int  i_dof 
)

Get the type of the degree of freedom for a given joint (linear or not)

This function is used to know if the degree of freedom is partialy in translation. For most of the joints p3d_jnt_is_dof_angular() and p3d_jnt_is_dof_linear() are opposit functions. But some joint like the helicoid joint are both linear and angular.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
Returns:
TRUE linear, FALSE not linear (angular)
int p3d_jnt_is_with_object ( p3d_jnt jntPt)

Indicate whether or not there is an object on the joint.

Note: the object could be pur graphic. To test also pur graphic object use p3d_col_object_is_pure_graphic().

Parameters:
jntPt,:the joint
Return values:
TRUEif there is an object / FALSE else
int p3d_jnt_object_after_joint ( p3d_jnt jntPt)

Indicate whether or not there is an object on or after the joint.

Note: the object could be pur graphic. To test also pur graphic object use p3d_col_object_is_pure_graphic().

Parameters:
jntPt,:the joint
Return values:
TRUEif there is an object / FALSE else
void p3d_jnt_scale ( p3d_jnt jntPt,
double  scale 
)

Change the scale factor of a joint.

Parameters:
jntPt,:the joint
scale,:the scale factor.
Note:
Update the matrice in the links owned by the joint.
Update the matrice of relative position with the object.
void p3d_jnt_set_dof ( p3d_jnt jntPt,
int  i_dof,
double  val 
)

Change the value of a degree of freedom for the given joint.

Note: this function doesn't check if the value is valid (between the bounds).

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
val,:the new value for this degree of freedom (expressed in radian for angles)
void p3d_jnt_set_dof_bounds ( p3d_jnt jntPt,
int  i_dof,
double  vmin,
double  vmax 
)

Change the value of the bounds for a given joint and degree of freedom.

Note: this function doesn't check if the values are valid (vmin<vmax).

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
vmin,:the new minimum bound for this degree of freedom (expressed in radian for angles)
vmax,:the new maximum bound for this degree of freedom (expressed in radian for angles)
void p3d_jnt_set_dof_bounds_deg ( p3d_jnt jntPt,
int  i_dof,
double  vmin,
double  vmax 
)

Change the value of the bounds for a given joint and degree of freedom.

Note:

  • this function doesn't check if the values are valid (vmin<vmax).
  • this function looks like p3d_jnt_set_dof_bounds(), but here angles are in degree
Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
vmin,:the new minimum bound for this degree of freedom (expressed in degree for angles)
vmax,:the new maximum bound for this degree of freedom (expressed in degree for angles)
void p3d_jnt_set_dof_deg ( p3d_jnt jntPt,
int  i_dof,
double  val 
)

Change the value of a degree of freedom for the given joint.

Note:

  • this function doesn't check if the value is valid (between the bounds).
  • this function looks like p3d_jnt_set_dof(), but here angles are in degree
Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
val,:the new value for this degree of freedom (expressed in degree for angles)
void p3d_jnt_set_dof_is_active_for_planner ( p3d_jnt jntPt,
int  i_dof,
int  flag 
)

Set the flag is_active_for_planner.

Note: This flag maybe redundant with the flag "is_user".

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
flag,:The status of the degree of freedom (planner controled (::TRUE) or not (::FALSE))
void p3d_jnt_set_dof_is_modified ( p3d_jnt jntPt,
int  i_dof,
int  val 
)

Set whether or not the degree of freedom as been modified.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
val,:the state of the degree of freedom (TRUE or FALSE)
void p3d_jnt_set_dof_is_user ( p3d_jnt jntPt,
int  i_dof,
int  flag 
)

Set the flag of user value.

Note: If it isn't controled by user, then it isn't controled by p3d_shoot. This flag could be used for placement joint, passif joint or degree of freedom computed by local method. A degree of freedom not controled by user does not appeared in user config.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
flag,:The status of the degree of freedom (user controled (::TRUE) or not (::FALSE))
void p3d_jnt_set_dof_rand_bounds ( p3d_jnt jntPt,
int  i_dof,
double  vmin,
double  vmax 
)

Change the value of the random bounds for a given joint and degree of freedom.

Note: this function doesn't check if the values are valid (jnt::vmin <= vmin <= vmax <= jnt::vmax).

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
vmin,:the new minimum random bound for this degree of freedom (expressed in radian for angles)
vmax,:the new maximum random bound for this degree of freedom (expressed in radian for angles)
void p3d_jnt_set_dof_rand_bounds_deg ( p3d_jnt jntPt,
int  i_dof,
double  vmin,
double  vmax 
)

Change the value of the random bounds for a given joint and degree of freedom.

Note:
  • this function doesn't check if the values are valid (jnt::vmin <= vmin <= vmax <= jnt::vmax).
  • this function looks like p3d_jnt_set_dof_rand_bounds(), but here angles are in degree
Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
vmin,:the new minimum random bound for this degree of freedom (expressed in degree for angles)
vmax,:the new maximum random bound for this degree of freedom (expressed in degree for angles)
void p3d_jnt_set_dof_v0 ( p3d_jnt jntPt,
int  i_dof,
double  val 
)

Change the value of v0 for a degree of freedom in the given joint.

Note: this function doesn't check if the value is valid (between the bounds). This function is used in the sdk.

Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
val,:the new value for this degree of freedom (expressed in radian for angles)
void p3d_jnt_set_dof_v0_deg ( p3d_jnt jntPt,
int  i_dof,
double  val 
)

Change the value of v0 for a degree of freedom in the given joint.

Note:

  • this function doesn't check if the value is valid (between the bounds).
  • this function looks like p3d_jnt_set_dof(), but here angles are in degree
  • this function is mainly used by the sdk.
Parameters:
jntPt,:the joint
i_dof,:the index of the degree of freedom
val,:the new value for this degree of freedom (expressed in degree for angles)
void p3d_jnt_set_is_active_for_planner ( p3d_jnt jntPt,
int  flag 
)

Set the flag is_active_for_planner for all degree of freedom of the joint.

Note: This flag maybe redundant with the flag "is_user".

Parameters:
jntPt,:the joint
flag,:The status of the degree of freedom (planner controled (::TRUE) or not (::FALSE))
void p3d_jnt_set_is_active_for_planner2 ( p3d_jnt jnt,
int  flag 
)

Desactive a joint for the planner with its dof.

Parameters:
robotPt
jnt
void p3d_jnt_set_is_user ( p3d_jnt jntPt,
int  flag 
)

Set the flag of user value for all degree of freedom of the joint.

Note: If it isn't controled by user, then it isn't controled by p3d_shoot. This flag could be used for placement joint, passif joint or degree of freedom computed by local method. A degree of freedom not controled by user does not appeared in user config.

Parameters:
jntPt,:the joint
flag,:The status of the degree of freedom (user controled (::TRUE) or not (::FALSE))
void p3d_jnt_set_mat_pos ( p3d_jnt jntPt,
p3d_matrix4 *  abs_pos 
)

Set the absolute position of a joint.

Parameters:
jntPt,:the joints.
abs_pos,:the absolute position of the joint (NULL if we want to set the joint matrix (jnt::jnt_mat) as the absolute position).
Remarks:
This function make the update of this joint.
void p3d_jnt_set_mat_pos_and_jac ( p3d_jnt jntPt,
p3d_matrix4 *  abs_pos 
)

Set the absolute position of a joint.

Parameters:
jntPt,:the joints.
abs_pos,:the absolute position of the joint (NULL if we want to set the joint matrix (jnt::jnt_mat) as the absolute position).
Remarks:
This function make the update of this joint.
void p3d_jnt_set_name ( p3d_jnt jntPt,
const char *  name 
)

Set the name of the joint.

Warning:
The size of the name must be less than :JNT_MAX_SIZE_NAME
Parameters:
jntPt,:the joint
name,:the name
int p3d_jnt_set_object ( p3d_jnt jntPt,
p3d_obj objPt 
)

Change the object attached to a joint.

Parameters:
jntPt,:the joint
objPt,:the object.
Returns:
0 if there is not concat 1 otherwise
Note:
This function update the relative position matrix between the p3d_poly of the object and the joint. If there is many objects associated to one joint, concat them to one object.
void p3d_jnt_stay_within_dist ( p3d_stay_within_dist_data prev_data,
p3d_jnt jntPt,
p3d_stay_within_dist_data data,
double *  distance,
configPt  q_init,
configPt  q_max_param,
double  max_param,
double *  reach_param 
)

Compute the distance and the speed that the joint could reach.

From the configuration q_init of the joint to q_max_param, this function computes an interval of parameter which all the points of the joint move by less than the distance given as input.

Note: The joint looks directly in the robot configurations the degree of freedom that it needs.

Parameters:
prev_data,:speed of the previous joint
jntPt,:the joint
distance,:the maximal distance
qinit,:the initial configuration
q_max_param,:the final configuration
max_param,:the value of the delta parameter in the final configuration (it gives the range param needed to reach the final configuration)
reach_param,:the actual maximal range that could be reach (previous joint can limits the range parameter)
Return values:
data,:speed of the joint distance: the distance that the joint couldn't cross reach_param: the new maximal range parameter that could be reach
void p3d_jnt_stay_within_sphere ( p3d_stay_within_dist_data prev_data,
p3d_jnt jntPt,
p3d_stay_within_dist_data data,
double *  distance,
double *  reach_param 
)

Compute the distance and the speed that the joint could reach for a fixed sphere.

From the bounds of the environement and based on the maximal speed, computes an interval (~radius) for which all the points of the joint move by less than the distance given as input.

Note: The joint looks directly in the robot configurations the degree of freedom that it needs.

Parameters:
prev_data,:speed of the previous joint
jntPt,:the joint
distance,:the distance for body linked to the joint to the nearest obstacle
Return values:
data,:speed of the joint distance: the distance that the joint couldn't cross reach_param: the new maximal range parameter that could be reach
void p3d_jnt_update_rel_pos_object ( p3d_jnt jntPt,
p3d_obj objPt 
)

Change the object attached to a joint.

Parameters:
jntPt,:the joint
objPt,:the object.
Note:
This function update the relative position matrix between the p3d_poly of the object and the joint.
p3d_jnt* p3d_robot_dof_to_jnt ( p3d_rob robotPt,
int  i_robot,
int *  i_joint 
)

Get the joint that hold the value of a degree of freedom for a given robot, return the index of this value in this joint.

Parameters:
robotPt,:the robot
i_robot,:the index of the degree of freedom in the robot configuration
Returns:
The joint that holds this degree of freedom (NULL if there is no joint that holds it)
Return values:
i_joint,:the index of the degree of freedom in the joint.
int p3d_robot_user_dof_to_dof ( p3d_rob robotPt,
int  i_user_dof 
)

Get the index of the user degree of freedom in the real configuration.

Parameters:
robotPt,:the robot
i_user_dof,:the index of the degree of freedom in the user configuration
Returns:
The index of this degree of freedom in the real configuration (-1 if there is no joint that holds it)
void p3d_SetWeightRotations ( double  RotationWeight)

p3d_SetWeightRotations() Set the value of the weight given to the rotations for distance computations. The total weight of rotations is given by WeightRota*jntPt->dist

Parameters:
the value given to weight the rotations
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines