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)
Contents
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:
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.
You can upload your own configurations by creating a .yaml-file and uploading it to the /script_server-namespace at the ROS parameter server.