Skip to content

NMAI-lab/ros2_rcss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2 RCSS

ros2_rcss
A demo of ROS2 RCSS

This is a ROS2 client for the RoboCup Soccer Simulation 2D.

Installation

Compile the Docker container as follows:

$ docker build --build-arg ROS_DISTRO=${ROS_VERSION} -t rcss .

Running the simulator

  1. Start the Docker container
$ xhost +local:docker

$ docker run --name rcss -it \
--env DISPLAY=$DISPLAY \
--env QT_X11_NO_MITSHM=1 \
--volume /tmp/.X11-unix:/tmp/.X11-unix:rw \
--volume $HOME/.Xauthority:/root/.Xauthority:rw \
rcss
  1. Launch the simulator inside the container
ros2 launch ros2_rcss rcss.launch.py [num_players:=] [team1:=] [team2:=]
  1. Verify that everything is working by doing
$ ros2 topic list
/A/player1/body
/A/player1/cmd/catch
/A/player1/cmd/dash
/A/player1/cmd/kick
/A/player1/cmd/say
/A/player1/cmd/turn
/A/player1/hear
/A/player1/see
/B/player1/body
/B/player1/cmd/catch
/B/player1/cmd/dash
/B/player1/cmd/kick
/B/player1/cmd/say
/B/player1/cmd/turn
/B/player1/hear
/B/player1/see

Usage

  • You can echo the perception topics as follows:
$ ros2 topic echo /[team]/player[number]/body
$ ros2 topic echo /[team]/player[number]/see
$ ros2 topic echo /[team]/player[number]/hear
  • You can publish to the action topics as follows:
$ ros2 topic pub -t 1 /[team]/player[number]/cmd/dash ros2_rcss_msgs/msg/DashCommand "{power: [value], direction: [value]}"
$ ros2 topic pub -t 1 /[team]/player[number]/cmd/turn ros2_rcss_msgs/msg/TurnCommand "{moment: [value]}"
$ ros2 topic pub -t 1 /[team]/player[number]/cmd/say ros2_rcss_msgs/msg/SayCommand "{message: [value]}"
$ ros2 topic pub -t 1 /[team]/player[number]/cmd/kick ros2_rcss_msgs/msg/KickCommand "{power: [value], direction: [value]}"
$ ros2 topic pub -t 1 /[team]/player[number]/cmd/catch ros2_rcss_msgs/msg/CatchCommand "{direction: [value]}"

Acknowledgements

About

A ROS2 client for RoboCup Soccer Simulation 2D.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors