(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Modifying parameter files

Description: This tutorial teaches you how to modify parameter files, e.g. for teaching new positions.

Tutorial Level: BEGINNER

Next Tutorial: Specify execution behaviour (python)

Script Server Parameters

The cob_script_server uses the ROS parameter server for making parameters available to different nodes. The parameters are added to the namespace of their component within the /script_server namespace, e.g. /script_server/tray for tray positions.

To check if a parameter is loaded type

rosparam list | grep script_server

If you already started a script_server (see Running a simple grasp script) you should see something like

/script_server/arm/folded
/script_server/arm/home
/script_server/arm/pregrasp
/script_server/arm/tablet
/script_server/base/home
/script_server/base/kitchen
/script_server/sdh/cylclosed
/script_server/sdh/cylopen
/script_server/sdh/home
...

Parameter files

The script server uses .yaml-files to load parameters to the ROS parameter server.

The default .yaml-files can be found in the cob_default_robot_config package

roscd cob_default_robot_config/cob3-3

The tray_joint_configurations.yaml-file could look similar to this:

   1 joint_names: ["torso_tray_joint"]
   2 
   3 up: [[0.0]]
   4 down: [[-3.1415926]]

Each entry is defined as a list of lists. The inner list contains all joint positions for a certain point. The outer list contains all points belonging to a certain trajectory. All commands are trajectories with one or more points.

Here you can see an example of a arm_joint_configurations.yaml file with points and trajectories:

   1 joint_names: ["arm_1_joint","arm_2_joint","arm_3_joint","arm_4_joint","arm_5_joint","arm_6_joint","arm_7_joint"]
   2 
   3 # single positions
   4 home: [[0,0,0,0,0,0,0]]
   5 folded: [[-1.16, -1.91, -2.53, -1.78, -2.84, -0.97, 1.76]]
   6 pregrasp: [[-1.3813, -1.9312, -1.7251, -1.4565, 0.7169, 1.0560, -2.1230]]
   7 wavein: [[1.5, 0.5, 0.0, -0.5, 0.0, 0.5, 0.0]]
   8 waveout: [[1.5, 0.5, 0.0, 0.5, 0.0, -0.5, 0.0]]
   9 
  10 # trajectories
  11 wave: [waveout, wavein, waveout, wavein]

The base.yaml-file for the base looks slightly different. Here you specify a 2D pose with in a 2D map, this means x- and y-position as well as the theta orientation around the z-axis.

   1 #[x,y,theta]
   2 home: [0, 0, 0]
   3 order: [0.5, -1, 0]
   4 kitchen: [-2.05, -1.36, 1.0]

You can upload your own configurations by creating a .yaml-file and uploading it to the /script_server-namespace at the ROS parameter server.

Wiki: cob_script_server/Tutorials/Modifying parameter files (last edited 2012-01-20 12:58:01 by NadiaHammoudeh)