Skip to content

Latest commit

 

History

47 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Simulation

Docker

The steps below build the srbc-simulation Docker image. It is based on ROS 2 Jazzy and contains a pre-built colcon workspace built from the packages listed in src/srbc.repos.

Install Docker:

sudo apt install -y docker.io docker-compose
sudo usermod -aG docker $USER

Log out and back in to use Docker without sudo.

Install vcstool:

sudo apt install -y python3-vcstool

Import dependency repositories listed in src/srbc.repos:

cd simulation
vcs import src < src/srbc.repos
vcs pull src

Build the image:

docker compose build build-image

Gazebo

Requires the srbc-simulation Docker image (see Docker section above).

Allow the Docker container to access the X11 display:

xhost +local:docker

Launch the Gazebo simulator:

docker compose up gazebo

gazebo

Bridged topics are defined in ros_gz_bridge.yaml:

Topic Type Direction Description
/clock rosgraph_msgs/msg/Clock GZ->ROS Simulation clock
/imu sensor_msgs/msg/Imu GZ->ROS IMU measurements
/joint_states sensor_msgs/msg/JointState GZ->ROS Robot joint states
/loc/gnss/aux/fix_vel_att gps_msgs/msg/GPSFix GZ->ROS Auxiliary GNSS fix
/loc/gnss/main/fix_vel_att gps_msgs/msg/GPSFix GZ->ROS Main GNSS fix
/vehicle/cmd_vel geometry_msgs/msg/Twist ROS->GZ Velocity command
/vehicle/cylinder/cmd_pos std_msgs/msg/Float64 ROS->GZ Cylinder position (m)
/vision/rgb/image_raw sensor_msgs/msg/Image GZ->ROS RGB camera image

A twist_mux node is also started to arbitrate velocity commands from multiple sources before publishing to /vehicle/cmd_vel. Its configuration is defined in twist_mux.yaml.

A cylinder_interface node interfaces Gazebo with nav_cylinders. It translates /vehicle/cylinders/cmd into /vehicle/cylinder/cmd_pos, and publishes /vehicle/cylinders/anchor_state from /joint_states.

An image_transport republish node compresses /vision/rgb/image_raw into /vision/rgb/image_raw/compressed (sensor_msgs/msg/CompressedImage).

Localization

Requires the srbc-simulation Docker image (see Docker section above).

Launch the localization stack:

docker compose up gazebo
docker compose up localization

This stack publishes vehicle odometry on /loc/odom by fusing GNSS and IMU data provided by Gazebo.

Navigation

Requires the srbc-simulation Docker image (see Docker section above).

Launch the navigation stack:

docker compose up gazebo
docker compose up localization
docker compose up navigation

The /loc/odom trajectory is continuously recorded in data/path_performed.json.

Convert data/path_performed.json to mission_order with Trajectory Editor and save it as data/path.json.

trajectory_editor

Place the robot near the first point of the trajectory, then start replay from a ROS 2 shell.

Inside the navigation container:

docker compose exec navigation bash

Or on the host (requires a local workspace build with the same ROS_DOMAIN_ID and RMW):

export ROS_DOMAIN_ID=0
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
source install/setup.bash

Configure replay (paused), then start the mission:

ros2 topic pub --once /auto/conductor_cmd nav_interfaces/msg/Conductor "{drive_mode: 1, pause: true, restart: false}"
ros2 topic pub --once /auto/conductor_cmd nav_interfaces/msg/Conductor "{drive_mode: 1, pause: false, restart: false}"

RViz

Requires the srbc-simulation Docker image (see Docker section above).

Allow the Docker container to access the X11 display:

xhost +local:docker

Open the 3D robot visualizer:

docker compose up rviz

rviz

Teleoperation

Requires the srbc-simulation Docker image (see Docker section above).

Launch the console keyboard teleoperation utility:

docker compose run --rm teleoperation
Reading from the keyboard  and Publishing to Twist!
---------------------------
Moving around:
          ↑
      ←       →
          ↓

z/s : increase/decrease linear speed
d/q : increase/decrease angular speed

CTRL-C to quit

gRPC

Exposes robot diagnostics and camera images to external clients over gRPC.

Launch the gRPC servers:

cd src/grpc_server
docker compose build build-grpc
docker compose build build-grpc-server
docker compose up simulation

You can connect from a mobile client with the SRBC iOS gRPC Example app to stream diagnostics and camera images.

grpc

About

ROS 2 / Gazebo simulation stack for the SRBC robot: localization, navigation, teleoperation, and gRPC interfaces.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages