ros2 practice example
1.0.0
This repository is for practicing some ros2 feature.
The publisher and subscriber of three different sensors are implemented.
The publisher is written in C++ and the subscriber is written in Python for eaiser usage of matplotlib visualization.
Each example contains some demonstrations:
Ubuntu 20.04 (on Windows11 wsl2)
ROS2 foxy
├── data_processor # Sensors subscriber and visualization tools
│ ├── data_processor
│ │ └── utils
│ ├── launch
│ ├── resource
│ ├── rviz # Rviz config file
│ └── test
├── sensor_interfaces # Custom temperature sensor data
│ ├── include
│ │ └── sensor_interfaces
│ ├── msg
│ └── src
└── sensors # Sensors publisher and launch file
├── include
│ └── sensors
├── laser_test_data # Test data for laser sensor
├── launch
└── src Clone project into src of ros2 workspace
cd {ros2_workspace}/src
git clone https://github.com/longhongc/ros2-practice-example.gitGo back to ros2 workspace and build
cd {ros2_workspace}
colcon buildRun nodes seperately
ros2 run sensors temp_publisher
ros2 run data_processor temp_subscriber Launch all nodes
ros2 launch sensors temp.launch
Run nodes seperately
ros2 run sensors speed_publisher
ros2 run data_processor speed_subscriber Launch all nodes
ros2 launch sensors speed.launch
Run nodes seperately
ros2 run sensors laser_publisher
ros2 run data_processor laser_subscriber Launch all nodes
ros2 launch sensors laser.launch