-
Notifications
You must be signed in to change notification settings - Fork 11
ROS Introduction
Robert Haschke edited this page Nov 28, 2023
·
9 revisions
- 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
- 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
- extends cmake to facilitate package management dependencies, installation to standard locations
- catkin_make, catkin_make_isolated, catkin tools
- hierarchical stacking of workspaces:
load config with:
/opt/ros/<distro> ⮤ /vol/famula/stable/ros/<distro> ⮤ /homes/juser/ros
source <workspace dir>/setup.bash
- workspace structure
- src/
- build/
- devel/
- setup.bash
# 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
# 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.xml
- defines folder as a ROS package
- defines dependencies: build, test, run
- author, license, package information
- CMakeLists.txt
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
rosrun roscpp_tutorials talker chatter:=foobar
rosrun roscpp_tutorials listener chatter:=foobar