+++ date="2023-03-14" author="spanskiduh" title="ROS" description="click to read about ROS" +++ # ROS ### Run ros on any distro [ROS-DOCKER](https://github.com/turlucode/ros-docker-gui) ### Basic commands - `catkin_make` builds the project. - `roscore` Start the root node. - `rosrun ` execute a node. - `rospack list` list all installed packages. - `rostopic list` list all the current active topics - `rostopic info ` print all the information about the topic(publishers / subscribers). - `rostopic pub ` send a message to a topic. - `rostopic echo ` subscribe to a topic. - `rostopic hz ` get frequency of messages. - `rosnode list` list all avaliable nodes. - `rosnode info ` get detailed information about the node. - `rosparam list` list all available parameters - `rosmsg info e.g. geometry_msgs/Twist` check the message structure. - `rosbag record --duration=` record some topic - `rosbag play ` replay the recorded topics (very usefull for debugging) ## RQT It is basically gui for command tools -> `topic monitor` gui topics ### Compiled packages are not listed? Re-source: `. ~/.bash.rc` or in docker container which uses zsh: `. ~/.zshrc`. ### Launchfile ```xml # define node # Parameters for our nodes (basically constants) # Use rosparam list to list them all # Remap topic ``` ### CmakeLists.txt ```bash # Here you add addidional packages: - rospy: to compile with python libraries - roscpp: ROs c++ compiler - geometry_msgs: Useful structs for position estimation find_package(catkin REQUIRED COMPONENTS rospy roscpp geometry_msgs) ```