Skip to content

nubot-nudt/NuBot_Rescue_Gazebo

Repository files navigation

NuBot_Pumbaa_Gazebo_Plugin

This is a Gazebo simulation plugin of NuBot_Pumbaa tracked vehicle.
Generated by NuBot-Rescue team.

Contact

Maitainer: Bailiang Chen bailiang.chen12@outlook.com
NuBot team (RoboCup team): nubot.nudt@outlook.com

Features Description

  1. Use joy/keyboard/rostopic::Twist to control the velocity & direction & flippers angle.
  2. Publish the robot pose through rostopic.
  3. 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.

  1. The flippers are controlled by directly setting the angle to the plugin.

Environment Requirements

Ubuntu 18.04 or 20.04(recommend)
ROS melodic or noetic(recommend)
Gazebo >= 9.0.0 or >=11.0.0(recommend)
Python 3

Additional Configurations

opende head files (contained in /gazebo_deps_opende)
threadpool libraries (need to be installed manually, as shown below)

Files Descriptions

/gazebo_deps_opende

  • This is a folder copy from the source code of gazebo(gazebo/deps/opende). It contains some head files needed by the plugin.

/Reference_File

  • This is a folder contains the original code of Martin Peica's work.

/Reference_File/threadpool-0_2_5-src.zip

  • 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/

/gazebo_description

  • 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

/pumbaa_plugin

  • The core code of NuBot_Pumbaa_Gazebo Plugin, to control the track robot more real.

/nubot_msgs

  • The self defined ROS message for Pumbaa control.

/nubot_teleop

  • The joy & keyboard teleop code of NuBot_Pumbaa in Python3.

/nubot_launch

  • The roslaunch files.

/velodyne_simulator

  • The LiDAR sensor simulator for Gazebo.

/hector_gazebo-melodic-devel

  • The hector_gazebo sensor pkg.

/rviz_state_publish

  • The rviz_state_publish node for rviz display.

Compilation Note

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.

Run the Project

After compilation,

  1. run:roscore
  2. open a new terminal tab or window: source devel/setup.bash
  3. 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
  1. to display robot in rviz: roslaunch nubot_launch rviz_pumbaa.launch

Control the Robot

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".

DualShock4 (PS4 joystick)

rosrun joy joy_node
rosrun nubot_teleop teleop_base2_gazebo_joy.py

with rostopic:"/nubot_msgs/base_drive_cmd".

Keyboard (message type: base_drive_cmd.msg)

rosrun nubot_teleop teleop_keyboard.py

with rostopic:"/nubot_msgs/base_drive_cmd".

Keyboard (message type: "geometry_msgs::Twist")

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.

Read sensor data

Robot pose in Gazebo

rostopic "/gazebo_state/pumbaa_pose"

Robot state (flipper angle, speed...)

rostopic "/nubot_drive/base_info" (message type: base_info.msg)

Camera

rostopic "/{camera_name}/image_raw"
change parameters (include {camera_name}) in:

/gazebo_description/models/NuBot_Pumbaa_v2/model_v2.urdf.xacro

IMU

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

LiDAR PointCloud2

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

Parameter Adjustment

You can adjust most robot & sensors & environment parameters by modifying the ".sdf", ".world", & ".xacro" files in "/gazebo_description".

Robot:

/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.

Camera:

/gazebo_description/models/camera_sensor/camera_sensor.urdf.xacro

LiDAR:

/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

IMU:

/gazebo_description/models/IMU/model.urdf.xacro

Installation of sensors in .sdf format:

/gazebo_description/world/Pumbaa_lidar_labfield.world

Installation of sensors in .xacro format:

/gazebo_description/models/NuBot_Pumbaa_v2/model_v2.urdf.xacro

TODO

  1. Add RGBD camera.
  2. Make the simulation more real.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published