Toy state machine in ROS
-
Build image
docker build --file docker/Dockerfile --tag ros_sm .
-
Run container (in WSL). Default container name is
ros_sm
./docker/docker.sh
- Make sure to check that
docker/docker.sh
points to correct docker image.
- Make sure to check that
-
Remember to build the ROS 2 packages before use. In
ros2_ws/
,colcon build
- Add
--symlink-install
to avoid having to rebuild each time source files are edited. - Add
--packages-select <package name>
to build specific packages only.
- Add
-
Remember to source the ROS 2 workspace before use. In
ros2_ws/
,. install/local_setup.bash
-
In one terminal, run the server.
ros2 run action_servers simple_action_server
-
In another terminal, send request to action server.
ros2 action send_goal simple_action custom_action_interfaces/action/Simpleaction "{simple_request: 3}"
- Add
--feedback
to display feedback messages.
- Add
To send instructions to the ROS state machine via CLI.
-
In one terminal, run the state machine.
ros2 run ros_sm ros_sm
-
In another terminal, run the command line publisher.
ros2 run cmdline_publisher cmdline_publisher