Gazebo simulation

From youBot wiki
Revision as of 16:09, 5 February 2015 by Florek-jasinska (Talk | contribs) (ROS Electric)

Jump to: navigation, search

YouBot Gazebo packages contains geometry, kinematics, dynamics and visual model of KUKA youBot in XML based format as also launch files and tools needed to operate the robot in Gazebo.

This installation guide assumes that ROS is already installed.

To install the model issue the following commands:


ROS Hydro

In order to work with simulated youBot in Gazebo you have to install ros-hydro-simulators and ros-hydro-youbot-silumation.

sudo apt-get install ros-hydro-simulators
sudo apt-get install ros-hydro-youbot-simulation 

To test if the installation was successful type in the terminal:

roslaunch youbot_gazebo_robot youbot_base_only.launch 

ROS Fuerte

ROS Groovy

ROS Electric

sudo apt-get install ros-electric-pr2-controllers
sudo apt-get install ros-electric-pr2-simulator  # required for trajectory_msgs and Gazebosimulator
mkdir ~/ros_stacks  # (if not done already)
git clone https://github.com/youbot/youbot-ros-pkg.git
git clone https://github.com/ipa320/cob_common.git # brics_actuator messages 

In case the folder ~/ros_stacks(the folder you have chosen to place the youbot-ros-pkg) has not yet been added to the $ROS_PACKAGE_PATH, you need to add this directory, by appending it in the /opt/ros/electric/setup.sh and either restarting the terminal window or typing:

 source /opt/ros/electric/setup.bash

You can check if it works by typing the following command:

roscd youbot_description

If the console switches to the youbot_description folder, then everything is fine. Otherwise there is probably something not correct with the $ROS PACKAGE PATH environment variable.

To compile the model use rosmake:

rosmake brics_actuator youbot_description

Usage

To run the simulation open a new console window and execute the following command:

$ roslaunch youbot_description youbot_arm_publisher.launch

This will bring up roscore, load youBot model, bring up and connect the Gazebo simulator.

Note: If you experience technical problems with Gazebo, rviz may be a good alternative for simulation process visualization:

$ roslaunch youbot_description youbot_arm_publisher_no_x.launch $ rosrun rviz rviz

In rviz click Add button and subscribe for Robot Model topic. In the field Target Frame specify base link for robot model: /base_link

Now you are ready to make your fist simulation. As a first step run the arm_joint_position_control_test example:

$ rosrun youbot_description arm_joint_position_control_test

This example shows how to control a youBot arm in joint position mode. Try out arm_joint_velocity_control_test and arm_joint_torque_control_test for joint velocity and torque control modes.

Note: examples above together with youbot_oodl ROS package could be used to control a real youBot. Installation instructions on youbot_oodl ROS package can be found under Frameworks section.