How to Use Controlit! with stickbot_bipedal_12dof (COM Position)

This section describes how to control the center-of-mass (COM) position of stickbot_bipedal_12dof.

Generate the Model

To generate the model:

$ roscd stickbot_bipedal_12dof_controlit/models/
$ ./generate_stickbot_bipedal_12dof_controlit_urdfs.sh

Launch Using a Single Command

To run the demo using a single command:

$ reset && roslaunch stickbot_bipedal_12dof_controlit simulate_com.launch 

Launch Using Multiple Commands

Start roscore:

$ roscore 

Start the shared memory manager:

$ rosrun shared_memory_interface shared_memory_manager

Open a new terminal and load the necessary parameters by executing one of the following commands:

$ roslaunch stickbot_bipedal_12dof_controlit load_stickbot_bipedal_parameters_com.launch 

The command above will load the parameters and then exit.

Start the simulation:

$ roslaunch stickbot_bipedal_12dof_controlit gazebo.launch 

Start the controller:

$ roslaunch stickbot_bipedal_12dof_controlit start_controlit.launch

The above command will start ControlIt! and block. Hit play in Gazebo to start the demo.

To view the robot in RViz:

$ rosrun rviz rviz 

Here is what you should see:

Usage Notes

Take a look in the YAML file: hcrl_robots/stickbot_bipedal_12dof/parameters/COMControl.yaml. You will see:

 tasks:
  - type: rapid/COMTask
    name: COMTask
    parameters:
     ... 
      - name: goalPosition
        type: vector
        value: [0, -0.25, 0.35]
     ...
     - name: projection
        type: matrix
        value: [[1, 0, 0],
                [0, 1, 0],
                [0, 0, 0]] 

The goal position is the initial goal of the COMTask. The projection matrix specifies that the COMTask controls only the X and Y positions of the COM.

To shift the robot to its right, execute:

$ rostopic pub --once /stickbot_bipedal_12dof_controller/COMTask/goalPosition std_msgs/Float64MultiArray '{layout: {dim: [{label: "x", size: 3, stride: 3}], data_offset: 0}, data: [0, -0.2, 0.1]}' 

Here is what you should see:

To shift the stick_bot_12dof to its left, execute:

$ rostopic pub --once /stickbot_bipedal_12dof_controller/COMTask/goalPosition std_msgs/Float64MultiArray '{layout: {dim: [{label: "x", size: 3, stride: 3}], data_offset: 0}, data: [0, -0.3, 0.1]}' 

Here is what you should see