1. What is ROS?
Robot operating System, simply robot operating system, the framework of weak coupling distributed processes, message passing between processes and management. Hardware abstraction and device control.
2, the node (node)
- ROS node is the core entity.
- ROS program period
- ROS communicate using middleware
- Can independently start and stop between nodes
3, and related concepts node
- message
- topic
- roscore :
- There is one and only one can run roscore
- You must first start roscore
- Responsible for scheduling communications
- Roscore publisher nodes and communications (e.g., to initialize a topic)
- publisher、subscriber
4, tool
catkin_create_pkg: Creating a package
catkin_make: Compile ROS program
rosrun: Run the program ros
rostopic: topics related to command
rostopic list; rostopic Hz topic1; rostopic topic1 bw; rostopic info topic1; rostopic echo topic1
rosnode list: to see a list of nodes running production
roslaunch: .launch by editing the file automatically start multiple nodes
rosbag: record and playback data on the topic
rosbag record topic1
rosbag play name1.bag
rqt_plot: for visualization of the results
5, common tools Details
catkin_create_pkg:
catkin_create_pkg [packageNmae] [dependency]
Dependencies: roscpp: using c ++ compiler, c ++ compatible interfaces; std_msgs: ros predefined data types
catkin_make:
package.xml : Organization ROS package, the package naming names, dependencies
<name></name>
<build_depend></build_depend>
<run_depend></run_depend>
The CMakeLists.txt : A simple example is as follows
cmake_minimum_required(VERSION 2.8.3) project(demo-proj1-nodes) # package name find_package(catkin REQUIRED COMPONENTS roscpp std_msgs ) catkin_package( # INCLUDE_DIRS include # LIBRARIES my_minimal_nodes # CATKIN_DEPENDS roscpp std-msgs # DEPENDS system_lib ) include_directories( include ${catkin_INCLUDE_DIRS} ) add_executable(my_minimal_publisher src/minimal_publisher.cpp) add_executable(my_minimal_publisher2 src/sleep_minimal_publisher.cpp) target_link_libraries(my_minimal_publisher ${catkin_LIBRARIES} ) target_link_libraries(my_minimal_publisher2 ${catkin_LIBRARIES} )
Compile command: catkin_make
After compilation there, devel and build two folders
rosrun:
At the outset environment variables: source ./devel/setup.bash
rosrun [Package-name] [executable name]