This is a Gazebo simulation plugin of NuBot_Pumbaa tracked vehicle.
Generated by NuBot-Rescue team.
Maitainer: Bailiang Chen bailiang.chen12@outlook.com
NuBot team (RoboCup team): nubot.nudt@outlook.com
- Use joy/keyboard/rostopic::Twist to control the velocity & direction & flippers angle.
- Publish the robot pose through rostopic.
- The robot tracks motion mechanism is based on the work of Martin Pecka.
M. Pecka, K. Zimmermann, and T. Svoboda, “Fast simulation of vehicles with non-deformable tracks,” Sep. 2017, pp. 6414–6419, doi: 10.1109/IROS.2017.8206546.
- The flippers are controlled by directly setting the angle to the plugin.
Ubuntu 18.04 or 20.04(recommend)
ROS melodic or noetic(recommend)
Gazebo >= 9.0.0 or >=11.0.0(recommend)
Python 3
opende head files (contained in /gazebo_deps_opende)
threadpool libraries (need to be installed manually, as shown below)
- This is a folder copy from the source code of gazebo(gazebo/deps/opende). It contains some head files needed by the plugin.
- This is a folder contains the original code of Martin Peica's work.
- This is a library pakage that may be needed during compilation. Just install it to the system.
(copy /boost/threadpool.hpp & threadpool/ to /usr/include/boost/ or /usr/local/include/boost/) - Extract .zip and run commands below to add them into your system:
sudo cp boost/threadpool.hpp /usr/include/boost/threadpool.hpp
sudo cp -r boost/threadpool/ /usr/include/boost/threadpool/
- The model of robot & terrain in the environment, including ".sdf", ".xacro" & ".world" file.
- transform .urdf to .sdf:
gz sdf -p my_model.urdf > my_model.sdf
- The core code of NuBot_Pumbaa_Gazebo Plugin, to control the track robot more real.
- The self defined ROS message for Pumbaa control.
- The joy & keyboard teleop code of NuBot_Pumbaa in Python3.
- The roslaunch files.
- The LiDAR sensor simulator for Gazebo.
- The hector_gazebo sensor pkg.
- The rviz_state_publish node for rviz display.
run:
mkdir src
cd src/
git pull https://github.com/nubot-nudt/NuBot_Rescue_Gazebo.git
cd ..
catkin_make
to compile the project.
if failed, check the library file in /Reference_File
mentioned above.
After compilation,
- run:
roscore
- open a new terminal tab or window:
source devel/setup.bash
- choose a launch file to run:
- for 2022RoboCup (robot in .xacro format):
roslaunch nubot_launch pumbaa_2022RoboCup.launch
- for robot in .xacro format:
roslaunch nubot_launch pumbaa_xacro.launch
- for robot in .sdf format:
roslaunch nubot_launch pumbaa_sdf.launch
- to display robot in rviz:
roslaunch nubot_launch rviz_pumbaa.launch
Control method: PS4-joystick or keyboard.
Change teleop_node in /nubot_launch/launch/xxx.launch
.
Control rostopic:"/nubot_msgs/base_drive_cmd", "/nubot_msgs/base_auto_cmd".
rosrun joy joy_node
rosrun nubot_teleop teleop_base2_gazebo_joy.py
with rostopic:"/nubot_msgs/base_drive_cmd".
rosrun nubot_teleop teleop_keyboard.py
with rostopic:"/nubot_msgs/base_drive_cmd".
rosrun nubot_teleop teleop_twist_keyboard.py
with rostopic:"/nubot_msgs/base_auto_cmd".
This topic is in "geometry_msgs::Twist" type, which can be used in auto navigation.
rostopic "/gazebo_state/pumbaa_pose"
rostopic "/nubot_drive/base_info" (message type: base_info.msg)
rostopic "/{camera_name}/image_raw"
change parameters (include {camera_name}) in:
/gazebo_description/models/NuBot_Pumbaa_v2/model_v2.urdf.xacro
rostopic "/imu/data"
change parameters in:
/gazebo_description/models/NuBot_Pumbaa_v2/model_v2.urdf.xacro
this is based on rospkg "hector_gazebo_ros_imu"
need sudo apt install ros-melodic-hector-gazebo-plugins
rostopic "/velodyne_points"
change parameters in:
/gazebo_description/models/NuBot_Pumbaa_v2/model_v2.urdf.xacro
For LiDAR in .sdf format, need to change "Fixed Frame" in Rviz to rs_helios
, and add rostopic "/velodyne_points".
GPU acceleration ([with a modern Gazebo build]), check details in rospkg "velodyne_simulator".
- The GPU fix was added to
gazebo7
in version 7.14.0 - The GPU fix was added to
gazebo9
in version 9.4.0
Use up-to-date packages from the OSRF Gazebo apt repository
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/gazebo-stable.list'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D2486D2DD83DB69272AFE98867170598AF249743
sudo apt update
sudo apt upgrade
Sadly, the GPU mode for lidar has awful point cloud for now.
https://bitbucket.org/DataspeedInc/velodyne_simulator/issues/15/gpu-mode-very-roughly-resoluted-scans-in
You can adjust most robot & sensors & environment parameters by modifying the ".sdf", ".world", & ".xacro" files in "/gazebo_description".
/gazebo_description/models/NuBot_Pumbaa/model.sdf
/gazebo_description/models/NuBot_Pumbaa_v2/model_v2.sdf
/gazebo_description/models/NuBot_Pumbaa_v2/model_v2.urdf.xacro
you can change mechanical parameters of robot, including friction, flippers PID and so on.
/gazebo_description/models/camera_sensor/camera_sensor.urdf.xacro
/gazebo_description/models/RS_Helios_5515/model.sdf /gazebo_description/models/RS_Helios_5515/model_2.urdf.xacro /gazebo_description/models/RS_Bpearl/model.sdf /gazebo_description/models/RS_Bpearl/model_2.urdf.xacro
/gazebo_description/models/IMU/model.urdf.xacro
/gazebo_description/world/Pumbaa_lidar_labfield.world
/gazebo_description/models/NuBot_Pumbaa_v2/model_v2.urdf.xacro
- Add RGBD camera.
- Make the simulation more real.