libmove3d
3.13.0
|
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_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. | |
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_jnt * | p3d_jnt_create_common (p3d_matrix4 pos) |
Create a new joint partialy defined. | |
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. | |
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. | |
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. |
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:
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
Attach a joint to an other.
prev_jntPt,: | the previous joint |
jntPt,: | the joint |
Attach a joint to an other but store the data only in the first joint.
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. |
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:
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
qinit,: | the initial robot configuration |
q_end,: | the final robot configuration |
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:
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. |
void p3d_jnt_calc_jnt_mat | ( | p3d_jnt * | jntPt | ) |
Compute the transformation matrix of the joint.
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.
link_jntPt,: | the link between two joints. |
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.
int p3d_jnt_calc_mat_pos_and_jac | ( | p3d_link_between_joint * | link_jntPt | ) |
Compute the absolute position matrix of the joint.
link_jntPt,: | the link between two joints. |
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.
void p3d_jnt_change_pos0 | ( | p3d_jnt * | jntPt, |
p3d_matrix4 | pos0 | ||
) |
Change the initial position of a joint.
jntPt,: | the joint |
pos0,: | the initial position matrix. |
void p3d_jnt_clean_update | ( | p3d_jnt * | jntPt | ) |
Clean up the flags used to check if the joint is updated.
jntPt,: | the joint. |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
body,: | the body |
the | maximal 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.
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 |
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.
type,: | the type of the joint |
pos,: | the position matrix of the 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.
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 |
Deattach a joint to an other.
jntPt1,: | the first joint |
jntPt2,: | the second joint |
void p3d_jnt_destroy | ( | p3d_jnt * | jntPt | ) |
Destroy a joint.
jntPt,: | the joint. |
void p3d_jnt_force_update | ( | p3d_jnt * | jntPt | ) |
Force the joint to be updated the next time.
jntPt,: | the joint |
void p3d_jnt_get_cur_vect_point | ( | p3d_jnt * | jntPt, |
p3d_vector3 | pos | ||
) |
Get the current absolut position of the joint.
jntPt,: | the joint |
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.
jntPt,: | the joint |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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".
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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 and
or between
and
, 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)
type,: | the type of joint |
i_dof,: | the index of the degree of freedom |
int p3d_jnt_get_dof_is_modified | ( | p3d_jnt * | jntPt, |
int | i_dof | ||
) |
Get whether or not the degree of freedom as been modified.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index 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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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".
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.
type,: | the type of the joint (::p3d_type_joint), |
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.
type,: | the joint type |
i_dof,: | the index of the degree of freedom |
Get the position initial of the joint.
jntPt,: | the joint |
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.
jntPt,: | the joint |
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 and
or between
and
, 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)
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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.
jntPt,: | the joint |
i_dof,: | the index of the degree of freedom |
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().
jntPt,: | the joint |
TRUE | if 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().
jntPt,: | the joint |
TRUE | if there is an object / FALSE else |
void p3d_jnt_scale | ( | p3d_jnt * | jntPt, |
double | scale | ||
) |
Change the scale factor of a joint.
jntPt,: | the joint |
scale,: | the scale factor. |
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).
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).
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:
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:
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".
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.
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.
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).
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.
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.
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:
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".
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.
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.
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.
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). |
void p3d_jnt_set_mat_pos_and_jac | ( | p3d_jnt * | jntPt, |
p3d_matrix4 * | abs_pos | ||
) |
Set the absolute position of a joint.
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). |
void p3d_jnt_set_name | ( | p3d_jnt * | jntPt, |
const char * | name | ||
) |
Set the name of the joint.
jntPt,: | the joint |
name,: | the name |
Change the object attached to a joint.
jntPt,: | the joint |
objPt,: | the 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.
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) |
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.
prev_data,: | speed of the previous joint |
jntPt,: | the joint |
distance,: | the distance for body linked to the joint to the nearest obstacle |
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 |
Change the object attached to a joint.
jntPt,: | the joint |
objPt,: | the object. |
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.
robotPt,: | the robot |
i_robot,: | the index of the degree of freedom in the robot configuration |
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.
robotPt,: | the robot |
i_user_dof,: | the index of the degree of freedom in the user configuration |
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
the value given to weight the rotations |