- Todo:
- Finish the description
There are three types of file in Move3D:
- The environment descrition file (*.p3d)
- The macro descrition file (*.macro)
- The scenario descrition file (*.sce) They can be edited (only the scenario can be modified by Move3D) to descripe the objects used by Move3D.
The files .p3d and .macro have always two commands very similar. One begins with p3d_ the other with M3D_.
Some definitions could be done in all the files like:
Common command for macro and p3d files.
p3d_beg_desc <type> <name>
Begin the descrition for <type> of object with the name <name> that ends with a p3d_end_desc.
- <name>: The name of the object describe.
- <type>: The type of the object:
- ::P3D_ENV, M3D_ENV: environment (only in p3d file)
- ::P3D_OBSTACLE, M3D_OBSTACLE: obstacle.
- ::P3D_ROBOT, M3D_ROBOT: robot.
- ::P3D_BODY, M3D_BODY: body.
M3D_beg_desc <type> <name> : has the same function.
p3d_end_desc
Finish the description began by p3d_beg_desc <type> <name>.
M3D_end_desc : has the same function.
p3d_add_desc_poly <name> [<type>]
Begin the description of a polyhedra that ends with p3d_end_desc_poly.
- <name>: The name of the polyhedra.
- <type>: The use of this polyhedra:
- ::P3D_GRAPHIC, M3D_GRAPHIC: no test of collision checking and the object is visible.
- ::P3D_REAL, M3D_REAL: test the collision and the object is visible (default value)
- ::P3D_GHOST, M3D_GHOST: test the collision checking but the object is not visible.
M3D_add_desc_poly <name> [<type>] : has the same function.
p3d_end_desc_poly
Finish the description began by p3d_add_desc_poly <name> [<type>].
M3D_end_desc_poly : has the same function.
p3d_add_desc_vert <x> <y> <z>
M3D_add_desc_vert : has the same function.
p3d_add_desc_face
M3D_add_desc_face : has the same function.
p3d_add_desc_cube
M3D_add_desc_cube : has the same function.
p3d_add_desc_srect
M3D_add_desc_srect : has the same function.
p3d_add_desc_box
M3D_add_desc_box : has the same function.
p3d_add_desc_pyramid
M3D_add_desc_pyramid : has the same function.
p3d_add_desc_cylindre
M3D_add_desc_cylindre : has the same function.
p3d_add_desc_cylindre_oval
M3D_add_desc_cylindre_oval : has the same function.
p3d_add_desc_prisme
M3D_add_desc_prisme : has the same function.
p3d_add_desc_cone
M3D_add_desc_cone : has the same function.
p3d_add_desc_snout
M3D_add_desc_snout : has the same function.
p3d_add_desc_skew_snout
M3D_add_desc_skew_snout : has the same function.
p3d_add_desc_rtorusslice
M3D_add_desc_rtorusslice : has the same function.
p3d_add_desc_ctorusslice
M3D_add_desc_ctorusslice : has the same function.
p3d_add_desc_sweptrectslice
M3D_add_desc_sweptrectslice : has the same function.
p3d_add_desc_sphere
M3D_add_desc_sphere : has the same function.
p3d_add_desc_half_sphere
M3D_add_desc_half_sphere : has the same function.
p3d_add_desc_sphere_shell
M3D_add_desc_sphere_shell : has the same function.
p3d_add_desc_oval
M3D_add_desc_oval : has the same function.
p3d_add_desc_half_oval
M3D_add_desc_half_oval : has the same function.
p3d_add_desc_tore
M3D_add_desc_tore : has the same function.
p3d_set_prim_pos
M3D_set_prim_pos : has the same function.
p3d_set_prim_pos_by_mat
M3D_set_prim_pos_by_mat : has the same function.
p3d_polyhedre_set_pos
M3D_polyhedre_set_pos : has the same function.
p3d_set_body_pos_by_mat
M3D_set_body_pos_by_mat : has the same function.
p3d_set_obst_color
M3D_set_obst_color : has the same function.
p3d_set_obst_poly_color
M3D_set_obst_poly_color : has the same function.
p3d_set_body_color
M3D_set_body_color : has the same function.
p3d_set_body_poly_color
M3D_set_body_poly_color : has the same function.
p3d_add_desc_jnt <type> <x> <y> <z> <axe x> <axe y> <axe z> {(<value dof> <value min dof> <value max dof>) ... } <parameters> <indice prev joint> [{(<value rand min dof> <value rand max dof>) ... }]
Add a joint to the kinematic structure of a robot. This function is based on p3d_add_desc_jnt_deg() for Move3D and on kmJointCreate() for Kineo.
- <type>: Type is ::p3d_type_joint (with the M3D_ or P3D_ beginning):
- ::P3D_ROTATE, M3D_ROTATE: Joint rotate (1 dof). Its default use is one rotation Rz.
- ::P3D_TRANSLATE, M3D_TRANSLATE: Joint translate (1 dof). Its default use is one translation z.
- ::P3D_PLAN, M3D_PLAN: Joint plan (3 dof). Its default use is 2 translation x, y and then a rotation Rz.
- ::P3D_FREEFLYER, M3D_FREEFLYER: Joint freeflyer (6 dof). Its default use is 3 translations x, y, z then 3 rotations Rx, Ry, Rz.
- ::P3D_PPIVOT, M3D_PPIVOT: Only use for compatibility reasons, int fact this is a ::P3D_ROTATE.
- <x> <y> <z>: This is the absolute position of the joint.
- <axe x> <axe y> <axe z>: is the new main axis to the joint (default is z axis). We use only one rotation to transform the z axis to it's new axis. For example a ::P3D_PLAN, (1, 0, 0) represent a rotation Ry 90 degree (z axis becomes x axis). So we have then two translations (-z, y), one rotation (Rx). This parametrage can't represent all placement, but it is compatible with previous version of Move3D. To specify any rotation use p3d_add_desc_xyz_jnt <type> <x> <y> <z> <Rx> <Ry> <Rz> {() ... } <parameters> <indice prev="" joint>=""> [{() ... }]
- {(<value dof> <value min dof> <value max dof>) ... }: There is the same number as <value dof> <value min dof> <value max dof> as the dof number of the joint. Angles are in degree.
- <value dof>: Value of the degree of freedom.
- <value min dof>: Value of the minimum bound for the degree of freedom.
- <value max dof>: Value of the maximum bound for the degree of freedom. If <value min dof> and <value max dof> are equal then the degree of freedom is not controlable by user (it doesn't appear in the user configuration).
- <parameters>: Parameters for the joint (presently not used).
- <indice prev joint>: Indice of the previous joint.
- [{(<value rand min dof> <value rand max dof>) ... }]: Optianal bounds values. There is the same number as <value rand min dof> <value rand max dof> as the dof number of the joint. Angles are in degree. (By default those bounds are equal respectivly to <value min dof> and <value max dof>).
- <value rand min dof>: Value of the minimum random bound for the degree of freedom.
- <value rand max dof>: Value of the maximum random bound for the degree of freedom.
M3D_add_desc_jnt <type> <x> <y> <z> <axe x> <axe y> <axe z> {(<value dof> <value min dof> <value max dof>) ... } <parameters> <name prev joint> [{(<value rand min dof> <value rand max dof>) ... }] This is the same function than before, but it gives the name and not the indice of the previous joint. In Fact this is the name of the object attached on the previous joint.
p3d_add_desc_xyz_jnt <type> <x> <y> <z> <Rx> <Ry> <Rz> {(<value dof> <value min dof> <value max dof>) ... } <parameters> <indice prev joint> [{(<value rand min dof> <value rand max dof>) ... }]
Add a joint to the kinematic structure of a robot. This function looks like p3d_add_desc_jnt <type> <x> <y> <z> <axe x>=""> <axe y>=""> <axe z>=""> {() ... } <parameters> <indice prev="" joint>=""> [{() ... }]. But the parametrage of the joint orientation change. This function is based on p3d_add_desc_jnt_deg() for Move3D and on kmJointCreate() for Kineo.
- <type>: Type is ::p3d_type_joint (with the M3D_ or P3D_ beginning):
- ::P3D_ROTATE, M3D_ROTATE: Joint rotate (1 dof). Its default use is one rotation Rz.
- ::P3D_TRANSLATE, M3D_TRANSLATE: Joint translate (1 dof). Its default use is one translation z.
- ::P3D_PLAN, M3D_PLAN: Joint plan (3 dof). Its default use is 2 translation x, y and then a rotation Rz.
- ::P3D_FREEFLYER, M3D_FREEFLYER: Joint freeflyer (6 dof). Its default use is 3 translations x, y, z then 3 rotations Rx, Ry, Rz.
- ::P3D_PPIVOT, M3D_PPIVOT: Only use for compatibility reasons, int fact this is a ::P3D_ROTATE.
- <x> <y> <z>: This is the absolute position of the joint.
- <Rx> <Ry> <Rz>: Three rotations to describe the orientation of the joints.
- {(<value dof> <value min dof> <value max dof>) ... }: There is the same number as <value dof> <value min dof> <value max dof> as the dof number of the joint. Angles are in degree.
- <value dof>: Value of the degree of freedom.
- <value min dof>: Value of the minimum bound for the degree of freedom.
- <value max dof>: Value of the maximum bound for the degree of freedom. If <value min dof> and <value max dof> are equal then the degree of freedom is not controlable by user (it doesn't appear in the user configuration).
- <parameters>: Parameters for the joint (presently not used).
- <indice prev joint>: Indice of the previous joint.
- [{(<value rand min dof> <value rand max dof>) ... }]: Optianal bounds values. There is the same number as <value rand min dof> <value rand max dof> as the dof number of the joint. Angles are in degree. (By default those bounds are equal respectivly to <value min dof> and <value max dof>).
- <value rand min dof>: Value of the minimum random bound for the degree of freedom.
- <value rand max dof>: Value of the maximum random bound for the degree of freedom.
M3D_add_desc_xyz_jnt <type> <x> <y> <z> <Rx> <Ry> <Rz> {(<value dof> <value min dof> <value max dof>) ... } <parameters> <name prev joint> [{(<value rand min dof> <value rand max dof>) ... }] This is the same function than before, but it gives the name and not the indice of the previous joint. In Fact this is the name of the object attached on the previous joint.
p3d_create_trailer_local_method
p3d_set_robot_radius
M3D_set_robot_radius : has the same function.
p3d_create_reeds_shepp_local_method
p3d_add_desc_rob_col_init <name>
Initialize the description of the autocollision for the robot <name>
M3D_add_desc_rob_col_init : has the same function.
p3d_desactivate_col_check <name1> [<name2>]
Deactive the collision between the object <name1> and <name2>, or use the automatic deactivation if <name1> is "automatic"
M3D_desactivate_col_check : has the same function.
Commands specific to p3d files.
les arguments de p3d_constraint dans le ficher .p3d sont:
p3d_constraint <name> <nb_dof_passif> [<jnt_passif_1> ... <jnt_passif_nb_dof_passif>] <nb_dof_actif> [<jnt_actif_1> ... <jnt_actif_nb_dof_actif>] <nb_param> [<param_1> ... <param_nb_param>] <nb_int> [<int_1> ... <int_nb_int>]
Create a constraint. This function is based on p3d_constraint().
- <name>: The constraints mane (and then its type)
- <nb_dof_passif>: the number of passive degree of freedom
- [<jnt_passif_1> ... <jnt_passif_nb_dof_passif>]: the passive joints index (we use the first degree of freedom of each joints).
- <nb_dof_actif>: the number of active degree of freedom
- [<jnt_actif_1> ... <jnt_actif_nb_dof_actif>]: the active joints index (we use the first degree of freedom of each joints).
- <nb_param>: the number of float parameters.
- [<param_1> ... <param_nb_param>]: the float parameters.
- <nb_int>: the number of integer parameters.
- [<int_1> ... <int_nb_int>>]: the integer parameters.
p3d_constraint_dof <name> [<jnt_passif_1> ... <jnt_passif_n>] [<dof_passif_1> ... <dof_passif_n>] [<jnt_actif_1> ... <jnt_actif_m>] [<dof_actif_1> ... <dof_actif_m>] [<param_1> ... <param_o>] [<int_1> ... <int_p>]
Create a constraint. This function is based on p3d_constraint_dof(). This function is nearly the same than p3d_constraint <name> <nb_dof_passif> [<jnt_passif_1> ... <jnt_passif_nb_dof_passif>] <nb_dof_actif> [<jnt_actif_1> ... <jnt_actif_nb_dof_actif>] <nb_param> [<param_1> ... <param_nb_param>] <nb_int> [<int_1> ... <int_nb_int>], but it is possible to choose the degree of freedom in each joint.
- <name>: The constraints mane (and then its type). The type defines the number of parameters needed with p3d_constraint_get_nb_param().
- [<jnt_passif_1> ... <jnt_passif_n>]: the passive joints index.
- [<dof_passif_1> ... <dof_passif_n>]: the passive degree of freedom in each joint index.
- [<jnt_actif_1> ... <jnt_actif_m>]: the active joints index.
- [<dof_actif_1> ... <dof_actif_m>]: the active degree of freedom in each joint index.
- [<param_1> ... <param_o>]: the float parameters.
- <nb_int>: the number of integer parameters.
- [<int_1> ... <int_p>>]: the integer parameters.
p3d_sel_desc_name
M3D_sel_desc_name : has the same function.
p3d_set_env_box
M3D_set_env_box : has the same function.
p3d_set_robot_box
M3D_set_robot_box : has the same function.
p3d_set_robot_pos <x> <y> <z> [<Rx> <Ry>] <Rz>
Change the origine of the robot.
M3D_set_robot_pos : has the same function.
p3d_set_obst_pos
M3D_set_obst_pos : has the same function.
p3d_set_obst_pos_by_mat
M3D_set_obst_pos_by_mat : has the same function.
M3D_set_body_pos
p3d_set_robot_goto
M3D_set_robot_goto : has the same function.
p3d_set_robot_current
M3D_set_robot_current : has the same function.
p3d_set_robot_steering_method
M3D_set_robot_steering_method : has the same function.
- p3d_read_macro <name file macro> <name object> [<scale factor>]:
Read a macro description file:
- <name file macro> (string) Name of the file
- <name file macro> (string) Name of the object build with this macro
- <scale factor> (double) Scale factor to use the macro in the environment
- p3d_read_macro <name file macro> <name object> [<scale factor>]:
The same function than p3d_read_macro
p3d_set_min_bounds <min1> [<min2> [<min3> [...]]]
Change the minimum value of the degree of freedom controled by user. This function is based on p3d_set_user_config_min_bounds_deg().
- <min1> [<min2> [<min3> [...]]]: The new values for minimum degree of freedom bounds.
Note:
- Only the degree of freedom controled by user could be modified (p3d_dof_data::is_user == ::TRUE).
- If all the bounds are not specified (size < rob::nb_user_dof) then the other bounds are not changed.
- Angles are in degree.
- The random bounds are modified to be between those new bounds.
M3D_set_min_bounds <min1> [<min2> [<min3> [...]]] : has the same function.
p3d_set_max_bounds <max1> [<max2> [<max3> [...]]]
Change the maximum value of the degree of freedom controled by user. This function is based on p3d_set_user_config_max_bounds_deg().
- <max1> [<max2> [<max3> [...]]]: The new values for maximum degree of freedom bounds.
Note:
- Only the degree of freedom controled by user could be modified (p3d_dof_data::is_user == ::TRUE).
- If all the bounds are not specified (size < rob::nb_user_dof) then the other bounds are not changed.
- Angles are in degree.
- The random bounds are modified to be between those new bounds.
M3D_set_max_bounds <max> [<max2> [<max3> [...]]] : has the same function.