Difference between revisions of "Simulation"

From cogniteam
Jump to: navigation, search
Line 43: Line 43:
 
The launch file contains hamster_multi_vehicle.launch which runs rwo agents
 
The launch file contains hamster_multi_vehicle.launch which runs rwo agents
 
You can add more agents by editing the launch file. Follow instructions in .launch file
 
You can add more agents by editing the launch file. Follow instructions in .launch file
 +
 +
<syntaxhighlight lang="bash" line='line'>
 +
roslaunch hamster_vehicle_gazebo hamster_multi_vehicle.launch
 +
</syntaxhighlight>
  
 
==Available Topics==  
 
==Available Topics==  

Revision as of 16:39, 11 December 2019

HamsterSimulationCTOffice.png

Hamster Simulation

Installation

First check your current version of ROS by simply typing in the following command:
<syntaxhighlight lang="bash" line='line'> rosversion -d </syntaxhighlight>

ROS Installation

Installation guide for ROS 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:
<syntaxhighlight lang="bash" line='line'> sudo apt-get install ros-<distro>-ros-control ros-<distro>-ros-controllers ros-<distro>-gazebo-ros ros-<distro>-gazebo-ros-control ros-<distro>-gazebo-ros-pkgs ros-<distro>-controller-manager ros-<distro>-gazebo-plugins ros-<distro>-hector-gazebo ros-<distro>-hector-gazebo-plugins ros-<distro>-ackermann-msgs </syntaxhighlight>


Next you should go ahead and create a catkin workspace:
<syntaxhighlight lang="bash" line='line'> source /opt/ros/<distro>/setup.bash mkdir -p ~/hamster_simulation/src cd ~/hamster_simulation/src catkin_init_workspace </syntaxhighlight> Now we can clone the Hamster simulation source code into the new workspace and make it:
<syntaxhighlight lang="bash" line='line'> git clone https://github.com/cogniteam/hamster_simulation.git cd ~/hamster_simulation catkim_make </syntaxhighlight>

Launching

Before continuing, source your workspace.
<syntaxhighlight lang="bash" line='line'> source ~/hamster_simulation/devel/setup.bash </syntaxhighlight>

The launch file contains hamster_multi_vehicle.launch which runs rwo agents You can add more agents by editing the launch file. Follow instructions in .launch file

<syntaxhighlight lang="bash" line='line'> roslaunch hamster_vehicle_gazebo hamster_multi_vehicle.launch </syntaxhighlight>

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