Difference between revisions of "Simulation"

From cogniteam
Jump to: navigation, search
Line 2: Line 2:
 
==Installation==
 
==Installation==
 
First check your current version of ROS by simply typing  in the following command:<br />
 
First check your current version of ROS by simply typing  in the following command:<br />
<code>
+
<pre style="color: silver; background: black;">
 
$ rosversion -d
 
$ rosversion -d
</code>
+
</pre>
  
 
Please consider that our recommended working version of ROS is Indigo. If needed, an installation guide for Indigo can be found at the following link: http://wiki.ros.org/indigo/Installation/Ubuntu
 
Please consider that our recommended working version of ROS is Indigo. If needed, an installation guide for Indigo can be found at the following link: http://wiki.ros.org/indigo/Installation/Ubuntu
  
 
Before cloning, Some dependencies are needed if not already installed:<br />
 
Before cloning, Some dependencies are needed if not already installed:<br />
<code>
+
<pre style="color: silver; background: black;">
 
$ sudo apt-get install ros-indigo-ros-control  ros-indigo-ros-controllers ros-indigo-gazebo-ros ros-indigo-gazebo-ros-control ros-indigo-gazebo-ros-pkgs ros-indigo-controller-manager ros-indigo-gazebo-plugins ros-indigo-hector-gazebo ros-indigo-hector-gazebo-plugins ros-indigo-ackermann-msgs
 
$ sudo apt-get install ros-indigo-ros-control  ros-indigo-ros-controllers ros-indigo-gazebo-ros ros-indigo-gazebo-ros-control ros-indigo-gazebo-ros-pkgs ros-indigo-controller-manager ros-indigo-gazebo-plugins ros-indigo-hector-gazebo ros-indigo-hector-gazebo-plugins ros-indigo-ackermann-msgs
</code>
+
</pre>
  
  
Line 30: Line 30:
 
==Launching==
 
==Launching==
 
Before continuing, source your workspace.<br />
 
Before continuing, source your workspace.<br />
<code>
+
<pre style="color: silver; background: black;">
$ source ~/hamster_simulation/devel/setup.bash
+
$ source ~/hamster_simulation/devel/setup.bash
</code>
+
</pre>
  
 
The launch file contains hamster_vehicle.launch which runs one agent called agent1
 
The launch file contains hamster_vehicle.launch which runs one agent called agent1
Line 39: Line 39:
 
Also, the launch file launches a joystick node if any is connected as working on /dev/js*
 
Also, the launch file launches a joystick node if any is connected as working on /dev/js*
 
To launch Gazebo, type in the following command:<br />
 
To launch Gazebo, type in the following command:<br />
<code>
+
<pre style="color: silver; background: black;">
$ roslaunch hamster_vehicle_gazebo hamster_vehicle.launch
+
$ roslaunch hamster_vehicle_gazebo hamster_vehicle.launch
</code>
+
</pre>
  
  

Revision as of 08:44, 27 February 2017

Hamster Simulation

Installation

First check your current version of ROS by simply typing in the following command:

$ rosversion -d

Please consider that our recommended working version of ROS is Indigo. If needed, an installation guide for Indigo can be found at the following link: http://wiki.ros.org/indigo/Installation/Ubuntu

Before cloning, Some dependencies are needed if not already installed:

$ sudo apt-get install ros-indigo-ros-control  ros-indigo-ros-controllers ros-indigo-gazebo-ros ros-indigo-gazebo-ros-control ros-indigo-gazebo-ros-pkgs ros-indigo-controller-manager ros-indigo-gazebo-plugins ros-indigo-hector-gazebo ros-indigo-hector-gazebo-plugins ros-indigo-ackermann-msgs


Next you should go ahead and create a catkin workspace:

$ source /opt/ros/indigo/setup.bash
$ mkdir -p ~/hamster_simulation/src
$ cd ~/hamster_simulation/src
$ catkin_init_workspace

Now we can clone the Hamster simulation source code into the new workspace and make it:

$ git clone https://github.com/cogniteam/hamster_simulation.git
$ cd ~/hamster_simulation
$ catkim_make

Launching

Before continuing, source your workspace.

$ source ~/hamster_simulation/devel/setup.bash

The launch file contains hamster_vehicle.launch which runs one agent called agent1 You can add more agents by editing the launch file.

Also, the launch file launches a joystick node if any is connected as working on /dev/js* To launch Gazebo, type in the following command:

$ roslaunch hamster_vehicle_gazebo hamster_vehicle.launch


Available Topics

You should see something like this: <agent> = agent1 on default

  • Camera - /<agent>/image_raw/
  • GPS - /<agent>/gps
  • IMU - /<agent>/imu
  • Lidar - /<agent>/scan_raw
  • Speed Commands (Ackermann) - /<agent>/ackermann_cmd