next up previous contents index
Next: Changing a color Up: Robots Previous: Joints

position of a robot

The kinematic structure of a Move3D robot is a tree who root is the specific joint j0 (cf Chapter gif). This joint allows the robot to translate along the x, y and z axis and to rotate around the z axis. It correspond, for example, to the four degrees of freedom of a plane. Every other joint adds a degree of freedom in rotation or translation. The different steps for setting a new position for the current robot come from this structure.

The function void p3d_set_robot_pos(double x, double y, double z, double t)   changes the values of the degrees of freedom of the joint j0 of the current robot. The function void p3d_set_robot_jnt(int i, double v)   changes the current value of the ith joint of the current robot.

   figure519
Figure: Setting the position of the current robot.

Once the user has changed the values of all or some of the joints, the position of the robot has been changed but not updated. The function int p3d_update_robot_pos(void)   must be called. This function computes the new position matrix of all the joints that have been affected by the changes (the joints whose value has been changed and the joints placed after those joints in the cinematic chain). It also updates the position of the robot's bodies, and the boundings boxes of the robot, objects and polyhedrons.

The position of a robot can be get using the following functions. The function void p3d_get_robot_pos(double *x, double *y, double *z, double *t)   returns the values of the degrees of freedom of the first joint j0 of the current robot, tex2html_wrap_inline1048 . The function void p3d_get_robot_jnt(int i, double *val)   returns the value of the i-th joint of the current robot.

Two functions allow the user to evaluate the distance between two configurations of the current robot.

The function double p3d_dist(p3d_rob *r, p3d_courbe *c, int nrs)   returns the distance covered by the robot r along the path c. The function double p3d_dist_q1_q2 (p3d_rob *r, double *q1, double *q2)   returns the distance covered by the robot r between the configuration q1 and q2 with the current local method. The distance are computed the same way : to the lenght of the curve covered by the four degrees of freedom of j0 is added the square root of the sum of the difference of all the degrees of freedom that are not x,y,z. This way the distance between two configurations can be evaluated whatever local method and configurations have been chosen.


next up previous contents index
Next: Changing a color Up: Robots Previous: Joints

Nicola Simeon
Fri Oct 27 09:07:38 MET DST 2000