daichi-yoshikawa / ahl_wbc

ahl_wbc contains ROS packages for whole body control / operational space control / task space control.
BSD 3-Clause "New" or "Revised" License
37 stars 9 forks source link

ahl_wbc

ahl_wbc is a metapackage that contains ROS packages for whole body control/operational space control/task space control.

What is Whole Body Control ?

Here, whole body control means a task space control, which is a control framework proposed by Prof. Oussama Khatib. If you use this framework,

Reference : The operational space framework

Contents

Packages

How does it work ?

Prerequisites

Installation

Install Ubuntu 14.04 LTS

Official documentation

Install ROS Jade

ROS is an open source middle ware for robot developers.
It serves vast amount of useful features and packages.
If you have enough strage, install ros-jade-desktop-full.
Official documentation

Create Catkin Workspace

Catkin is a cmake-based build system supported by ROS.
In catkin workspace, we edit codes and build software.
Official documentation

Install Gazebo 5.0

Gazebo is a robotic simulator, which provides visualization, physics and collision detection in virtual environment.

sudo apt-get install gazebo5

Install ros-control and ros-controllers

In order to fully make use of gazebo with ROS, we need these controllers.

sudo apt-get install ros-jade-ros-control ros-jade-ros-controllers

Install ROS Packages for Whole Body Control.

In your catkin_ws/src/ahl_ros_packages, execute the follows.

git clone https://github.com/daichi-yoshikawa/existing_packages.git
git clone https://github.com/daichi-yoshikawa/ahl_common.git
git clone https://github.com/daichi-yoshikawa/ahl_wbc.git

Get Started with Gazebo Simulation

You need two terminals.

Firstly, you have to launch ros node which provides virtual robot model.
In this phase, no window will pop up, because gazebo GUI is off by default.

If you'd like to simulate KUKA youBot,

roslaunch ahl_youbot_description youbot.launch

Or if you'd like to simulate PR2,

roslaunch ahl_pr2_description pr2.launch

And then, launch the whole body controller.
If you make success, rviz will pop up and you can see robot model in it.
If you launched youbot.launch at the previous step,

roslaunch ahl_robot_samples youbot.launch

Or if you launched pr2.launch at the previous step,

roslaunch ahl_robot_samples pr2.launch

Note : You have to tune parameters in order to make it fine. See the following section "Tuning parameters".

Tuning parameters

Actually, default control gains are very low, so the robot is not properly controlled. It is because simulator would get unstable, if gains were set to high values from the beginning.

Therefore, you need to increase gains after you launch simulator. It can be done with window named "rqt_reconfigure__Param - rqt".

Case youbot simulation : Select youbot_sample->ahl_robot_controller in the window and set parameters as the follows.

kp_joint = 50.0
kv_joint = 5.0
kp_task_pos = 70.0
ki_task_pos = 0.0
kv_task_pos = 5.0
kp_task_ori = 200.0
ki_task_ori = 0.0
kv_task_ori = 5.0 

Usage

ahl_robot_samples is a good reference to know how to use APIs.
You have two ways to control physical robots.

  1. Based on input of desired torques at joints (Torque sensors and solid torque control is MUST.)
  2. Based on input of desired angles at joints (Works without torque sensors but cannot control a force)

ahl_ctrl::RobotController::computeGeneralizedForce derives desired torques.
ahl_ctrl::RobotController::simulate computes desired joint angles based on torques derived by ahl_ctrl::RobotController::computeGeneralizedForce.

Most robots don't have torque sensor on it. Therefore ahl_ctrl::RobotController::simulate will help you.

Gazebo Simulation

ahl_youbot_description and ahl_pr2_description are good references to setup robot model for simulation.

Physical Robot (Editing)

Be careful ! Torque control is difficult !!