Difference between revisions of "Gazebo simulation"

From youBot wiki
Jump to: navigation, search
Line 6: Line 6:
  
 
===ROS Electric ===
 
===ROS Electric ===
<code> $ sudo apt-get install ros-electric-pr2-controllers </code>
+
<pre>$ sudo apt-get install ros-electric-pr2-controllers
 
+
$ sudo apt-get install ros-electric-pr2-simulator # required for trajectory_msgs and Gazebosimulator
<code> $ sudo apt-get install ros-electric-pr2-simulator </code> # required for trajectory_msgs and Gazebosimulator
+
$ mkdir ~/ros_stacks  # (if not done already)
<code> $ mkdir ~/ros_stacks  # (if not done already)</code>
+
$ git clone https://github.com/youbot/youbot-ros-pkg.git
<code> $ cd ~/ros_stacks</code>
+
$ git clone https://github.com/ipa320/cob_common.git # brics_actuator messages </pre>
<code> $ git clone https://github.com/youbot/youbot-ros-pkg.git</code>
+
<code> $ git clone https://github.com/ipa320/cob_common.git # brics_actuator messages </code>
+
  
 
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:
 
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:
Line 55: Line 53:
 
=== ROS Hydro ROS Indigo===
 
=== ROS Hydro ROS Indigo===
  
<code>sudo apt-get install ros-%YOUR_ROS_DISTRO%-simulators
+
<pre>sudo apt-get install ros-%YOUR_ROS_DISTRO%-simulators
 
+
sudo apt-get install ros-%YOUR_ROS_DISTRO%-youbot-simulation </pre>
sudo apt-get install ros-%YOUR_ROS_DISTRO%-youbot-simulation </code>
+

Revision as of 10:10, 19 December 2014

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. You can install different Gazebo versions than the one from instalaton guide if needed, however, please note that there are many issues ??? with connecting ROS and Gazebo

To install the model issue the following commands:

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.

ROS Fuerte

ROS Groovy

ROS Hydro ROS Indigo

sudo apt-get install ros-%YOUR_ROS_DISTRO%-simulators
sudo apt-get install ros-%YOUR_ROS_DISTRO%-youbot-simulation