Skip to content
Robert Haschke edited this page Nov 28, 2023 · 9 revisions

ROS: Robot Operating System

  • middleware, i.e. inter-process communication
  • hardware abstraction for robots
  • message definitions (for RPC)
  • package management system, tailored towards development
  • collection of open-source software packages
  • multi language: C++, Python, Java
  • multi platform: (Ubuntu Linux), Windows 10, OSX

middleware concepts

  • topics (publish - subscribe)
  • services (remote procedure calls)
  • nodes: logical computing components, several per process possible
  • central naming service (roscore)
  • remapping: renaming of nodes, topics, etc.
  • central parameter storage

further reading

catkin build system

  • extends cmake to facilitate package management dependencies, installation to standard locations
  • catkin_make, catkin_make_isolated, catkin tools
  • hierarchical stacking of workspaces:
    /opt/ros/<distro>
     ⮤ /vol/famula/stable/ros/<distro>
        ⮤ /homes/juser/ros
    
    load config with: source <workspace dir>/setup.bash
  • workspace structure
    • src/
    • build/
    • devel/
      • setup.bash

catkin_make_isolated

# create your catkin workspace
mkdir -p ~/ros/src
cd ~/ros/src
source /opt/ros/*/setup.bash # source your underlay workspace
catkin_init_workspace

# clone lecture repository from github
git clone https://github.com/rhaschke/lecture
# catkin_make_isolated needs to run from root of your workspace
cd ..
catkin_make_isolated

catkin tools

# install catkin tools (if not yet available)
sudo apt install python3-catkin-tools python3-osrf-pycommon

# create your catkin workspace
mkdir ~/ros
cd ~/ros
# catkin tools can remember your underlay workspace:
catkin config --extend /opt/ros/<distro>
mkdir src
cd src

# clone lecture repository from github
git clone https://github.com/rhaschke/lecture

# catkin can build from any folder in your workspace
cd lecture
catkin build

For more details on catkin config and catkin create pkg follow the links.

package structure

  • package.xml
    • defines folder as a ROS package
    • defines dependencies: build, test, run
    • author, license, package information
  • CMakeLists.txt

example ros session

source ~/ros/devel/setup.bash
roscore &
rostopic pub -r 1 chatter std_msgs/String "Hello World" &
rostopic echo chatter

Inspect ros universe:

rosnode list
rostopic list
rosservice list
rosmsg list

rqt_graph

Remapping arguments

rosrun roscpp_tutorials talker chatter:=foobar
rosrun roscpp_tutorials listener chatter:=foobar