Example Package on how to handle ROS2 Publishers & Subscribers, used for the Exploration Rover Lecture, Institute for Space Systems, University Stuttgart. Germany
Go to file
2021-03-16 13:59:12 +01:00
src pubsub_v2 2021-03-09 22:12:06 +01:00
bashrc_addons.bash first test push 2021-01-13 15:28:01 +01:00
instructions_custom_topics.md Update 'instructions_custom_topics.md' 2021-02-06 16:18:35 +01:00
Links.md first test push 2021-01-13 15:28:01 +01:00
README.md Update 'README.md' 2021-03-16 13:59:12 +01:00
rpi_install.bash Update 'rpi_install.bash' 2021-03-16 13:49:32 +01:00
workshopinstall.sh first test push 2021-01-13 15:28:01 +01:00

pubsub - Publisher & Subscriber Package

Publisher & Subscriber template package and source code.

Created for ROS Workshop 2020
Roverentwicklung für Explorationsaufgaben
Institute for Space Systems
University of Stuttgart.

Created by Patrick Winterhalder,
IRS, University of Stuttgart.

Workshop Prerequisites

For the workshop to be conducted on your Ubuntu 20.04 (64 bit) you must conduct this installation for desktop machines or this installation for the Raspberry Pi. Go through the bash commands (console) step by step!

  • Install Ubuntu 20.04
  • Install Visual Studio Code using the Ubuntu Software Installer
  • Install Git (no account required yet)
  • Install ROS2 ("desktop" on PC, "base" on Raspberry Pi).
    • Also install argcomplete
    • No need for ROS 1 bridge or RMW implementations
  • Install and update rosdep

After a successful installation of ROS2 you should get to know it by working through the "Beginner: CLI Tools" tutorial. This will teach you how to configure your ROS 2 environment:

  • Source setup files (underlay, overlay)
  • Configure .bashrc (shell startup script)
  • Add colcon_cd to .bashrc (shell startup script)
  • Check environment variables (check for correct installation)
  • Configure ROS_DOMAIN_ID (DDS Network Number)
  • Cover turtlesim, rqt, topics, services, actions

Install Instructions

  • Move to colcon workspace: cd <workspace_path>
  • Clone repository: git clone git://github.com/patrickw135/pubsub.git . (include the . at the end)
  • Build workspace: colcon build
    Note: Only the files inside src/ are of importance.
  • Remember to run source ~/<workspace_path>/install/local_setup.sh after every build. Best would be to add this command to .bashrc which is run everytime you start a new console.

During Workshop

  • Create workspace:
    • Install colcon: sudo apt install python3-colcon-common-extensions -y
  • Create packag inside ~/{workspace_name}/src:
    • ros2 pkg create --build-type [ament_cmake, ament-python] <package_name>
    • Go back up one layer: cd ..
    • Build workspace: colcon build --symlink-install
  • Add this to end of .bashrc (sudo nano .bashrc), find all instances of "~/ws_overlay_foxy" and replace it with your local path to your colcon workspace
  • Follow these instructions to create a custom message to define the interface between nodes