=============
This is the 2019 FIRA SIMUROSOT ROBO CHANLLENGE environment
OS: ubuntu 16.04
ROS: Kinectic
❗You must not install the ROS on a(any) Virtual Machine, otherwise there will be a lot of problems.❗
This competition mainly uses vision to avoid obstacles.In the game, you need to adjust the position information of the car through vision. Summary: You can only get images from the platform server, and then send commands to the server to control the car.
You can go to: http://wiki.ros.org/kinetic/Installation/Ubuntu
for how to download the ROS Kinetic version.
Here we copy some of the proceed below:
-
Setup your sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
-
Setup your keys
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
-
Installation
sudo apt-get update sudo apt-get install ros-kinetic-desktop-full
-
Initialize rosdep
sudo rosdep init rosdep update
-
Environment setup
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc source ~/.bashrc
```
sudo apt-get install ros-kinetic-turtlebot-gazebo
```
In your home directory, Press Ctrl+H to show the hidden directory, then go to gazebo/models sub-directory. Copy the models1/newbox and models1/newfield models1/colorbox to this directory.
There are two modes of running programs. The first is to run both the server and the client on one machine, and the second is to run the server and client on two machines.The following will explain how to run these two modes:
export LD_LIBRARY_PATH=~/ros_scripts/plugin:$LD_LIBRARY_PATH
roslaunch turtlebot_gazebo turtlebot_world.launch world_file:=/home/username/ros_scripts/world/world1-1
if you have trouble run the roslaunch, try to run the following first :
roslaunch turtlebot_gazebo turtlebot_world.launch
here username should be replaced with your username. And you can run another world_file just by replace the world1-1 to another one. open a terminal and run :
python robot_ser.py
you will see a prompt >>, you can input a string which is a file name , and the log will be saved to this file. then you can open another terminal and run:
python how_to_run.py
4.3.2.2 Download this project on both computer.On the client side, change the ip in the robot_cli.py and clock_cli.py files to the IP address of the A computer.
export LD_LIBRARY_PATH=~/ros_scripts/plugin:$LD_LIBRARY_PATH
roslaunch turtlebot_gazebo turtlebot_world.launch world_file:=/home/username/ros_scripts/world/world1-1
here username should be replaced with your username. And you can run another world_file just by replace the world1-1 to another one.
python clock_ser.py
python robot_ser.py
roscore
python clock_cli.py
python how_to_run.py
If you see the figure as follow, you are success.
./ros_scripts
├── how_to_run.py
├── robot.py
├── robot_ser.py
├── robot_cli.py
├── clock_ser.py
├── clock_cli.py
├── judge.py
└── world.world
This script define how the turtlebot act. There is only one function "Run" in this script, The function has a "robot" parameter, which is an object of class "Robot".
This script define a Robot class.Mainly describes the function of the robot.
set_move_speed(met_per_sec) : Set the speed of turtlebot,dimension is m/s.
set_turn_speed(deg_per_sec) : Set the rotate speed of turtlebot, dimension is degree/s.
go_forward(seconds) : Let the turtlebot move for "seconds" seconds at the given speed.
turn_around(seconds) : Let the turtlebot turn around for "seconds" seconds at the given rotate speed.
get_image() : Get the current image from camera. The image contain the RGB information as a 2D matrix.
The script mainly defines how to receive information from the robot and calls the function to control the robot.
The script mainly defines how to receive the state information of the robot from the server and send control commands to the server.
Record the time of the server to synchronize with the client
Record the time of the client to synchronize with the server
This script is used to record the robot's game time and determine whether the game is successfully completed.
This file define the enviroment which include play field and obstacles. It will be called by "start.py" script. We have defined some more testing enviroment in the "world" sub-directory. You can use them for testing.
The given demo is really simple for beginners to start up. You can define more sophisticate function based on "robot.move_cmd" and "robot.turn_cmd" to set. And using "robot.cmd_vel.publish(robot.move_cmd)" to publish you manipulation. Such as simulatanious turn around and moving.
You only go to the path .gazebo/models/newbox/materials/textures,then exchange the naming of two images
The compatible is not good. The platform can only run on gazebo7.0.0, and if you update the gazebo, some problem will occur. So for the future, the enviroment should run on a more varity platform. For different OS, ROS and GAZEBO version.