Please cite this paper if you use the code in your work. Taher Ahmadi, Sajad Azami
Note: By the end of April 2017, we are going to release base_code version 2.0.
UPDATE(July 2017): This code is now deprecated and replaced with base_code-v2, as promised.
Team SOSvr Virtual Robot Simulation Base Code
This is our base code that can be used to build different robots for performing different tasks and simulate them in 3D with Gazebo. We have used ROS for developing our robot and used P3AT as the robot's model. For setting up this robot refer to the usage section.
We assume you have an Ubuntu 14.04 machine set up. Follow these steps to bring up the robot:
First you have to install ROS indigo:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 0xB01FA116
sudo apt-get update
sudo apt-get install ros-indigo-desktop
For using 3D simulated environment we use Gazebo5. Install it with these commands:
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install ros-indigo-gazebo5-ros-pkgs
This packages are needed for the code to be maked and compiled:
sudo apt-get install ros-indigo-controller-manager
sudo apt-get install ros-indigo-joy
sudo apt-get install ros-indigo-gmapping
sudo apt-get install ros-indigo-move-base
Here we should first create a catkin workspace and compile and run our code. Follow these steps to finally see the result:
Use these commands to create a catkin workspace: (here we name it catkin_ws)
source /opt/ros/indigo/setup.bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
Then copy the contents of src folder from here to the src folder of your workspace.
Assuming you're in the home directory and your catkin workspace folder is named catkin_ws use these commands:
cd catkin_ws
catkin_make
Run this command before run each
source ./devel/setup.bash
or (if using zsh shell )
source ./devel/setup.zsh
Use these commands to bring up the 3D environment with the robot spawned in it: (Run each in seprate terminal session and dont forget to run the command from previous step before each)
roslaunch bring_up server.launch
roslaunch bring_up client.launch
roslaunch bring_up gmapping.launch
roslaunch bring_up move_base.launch
Then Gazebo should be up and running with robot spwaned in it :)
connect the joystick then Run:
roslaunch bring_up teleop_joy.launch
but you still can't drive the robot unless you run:
rqt --force-discover
choose the "SOSVR Controller" from Plugins menu then select the robot1 and press play button. press A & RB buttons at the same time for speed mode, now Enjoy your ride :)