Repo symbol

ros2-code-examples repository

docker robotics ros2
Repo symbol

ros2-code-examples repository

docker robotics ros2
Repo symbol

ros2-code-examples repository

docker robotics ros2
Repo symbol

ros2-code-examples repository

docker robotics ros2

Repository Summary

Description Collection of tutorials and examples for the Robot Operating System ROS 2
Checkout URI https://github.com/alsora/ros2-code-examples.git
VCS Type git
VCS Version master
Last Updated 2020-09-13
Dev Status UNKNOWN
Released UNRELEASED
Tags docker robotics ros2
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

README

ros2-code-examples

The following tutorials and examples are updated for ROS 2 Dashing Diademata (Released in May 2019).

This repository also contains some Dockerfile for running different ROS2-based environments. You can find them here.

Requirements

Note: you can still use ROS2 Bouncy Bolson, but you will not be able to compile the simple_actions package or to reproduce the examples of simple_navigation, simple_bag, simple_gazebo and simple_rqt.

Building the examples

Source your ROS2 SDK, then create a workspace, add this repository to its sources and build the packages.

$ source <PATH_TO_ROS2_SDK_WS>/install/setup.sh
$ mkdir -p ws/src
$ cd ws/src
$ git clone https://github.com/alsora/ros2-code-examples
$ cd ..
$ colcon build
$ source install/local_setup.sh

For more detailed build instructions look here

Running the examples

For each of the following tests, run the each command in a separate terminal window (remember that the ROS2 SDK has to be sourced in every terminal window!)

Publisher/Subscriber

    $ ros2 run simple_publisher publisher_main

    $ ros2 run simple_subscriber subscriber_main

One process publishes messages and the other subscribes to that topic.

Service/Client

    $ ros2 run simple_service service_main

    $ ros2 run simple_client client_main

One process provides a service and the other requests it.

Running simple_client/timer_main contains an alternative implementation for the ROS2 client node.

Actions Service/Client

    $ ros2 run simple_action service_main

    $ ros2 run simple_action client_main

One process provides an action service and the other requests it. The server node can reject the goal according to the request parameters. The client node can cancel the action if it’s taking too much time.

Logger utils

    $ ros2 run simple_logger logger_main

Log some messages and change the verbosity level at runtime.

Multithread systems

    $ ros2 run simple_multithread multithread_main

Run multiple nodes in separate threads from the same process.

Time Synchronization message filters

NOTE This example requires

    $ ros2 run simple_time_sync publisher

    $ ros2 run simple_time_sync time_sync_main

One process publishes messages on multiple topics. Sometimes it publishes only on one topic, sometimes on all with the same timestamp and sometimes on all but with slightly different timestamps. The other process create an approximate and an exact time subscribers.

Parameter servers

File truncated at 100 lines see the full file

Repo symbol

ros2-code-examples repository

docker robotics ros2
Repo symbol

ros2-code-examples repository

docker robotics ros2
Repo symbol

ros2-code-examples repository

docker robotics ros2
Repo symbol

ros2-code-examples repository

docker robotics ros2