yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Raspberry Pi 4B📖
1.Preparation before use
  • 1.1 Download image
  • 1.2 Write image into SD card
  • 1.3 Start up Raspberry Pi
  • 1.4 Linux common commands
  • 1.5 Precautions
2.Basic course
  • 2.1 Log into Raspberry Pi system
  • 2.2 Change password and root account
  • 2.3 Remote transfer file
  • 2.4 Backup image file
  • 2.5 Fixing Raspberry Pi IP
  • 2.6 Set screen keep on
  • 2.7 Get Pi temperature
  • 2.8 Connect WIFI
  • 2.9 Modify Pi time
  • 2.10 Set the boot self-starting program
3.Expand course
  • 3.1 Serial port communicates with external devices
  • 3.2 2.Serial port login Pi
  • 3.3 Configured as a router
  • 3.4 Install Jupyter Lab
  • 3.5 Install Jupyter Widgets
  • 3.6 More Detail for Widgets
  • 3.7 Install OpenCV
  • 3.8 Install Tensorflow
4.Programming course
C language
  • 1.Development environment
  • 2.Print Hello World
  • 3.Pin output level
  • 4.Read pin level
  • 5.PWM output
Python language
  • 1.Development environment
  • 2.Print basic usage
  • 3.Pin output level
  • 4.Read pin level
  • 5.PWM output
5.AI vision course
A.Getting started with OpenCV
  • 6.Picture Rotation
  • 1.Introduction of OpenCV
  • 2.OpenCV image read and display
  • 3.OpenCV image write
  • 4.OpenCV image quality
  • 5.OpenCV pixel operation
B.OpenCV Geometric transformat
  • 1.Picture Zoom
  • 2.Picture Cut
  • 3.Picture Shift
  • 4.Picture Mirroring
  • 5.Affine Map
  • 7.Perspective Transformation
C.OpenCV picture processing
  • 1.Grayscale processing
  • 2.Image Binarization
  • 3.Edge detection
  • 4.Drawing line segment
  • 5.Drawing rectangle circle
  • 6.Drawing text picture
D.OpenCV image beautification
  • 1.Histogram of color pictures
  • 2.Histogram equalization
  • 3.Image restoration
  • 4.Brightness enhancement
  • 5.Skin whitening
  • 6.Gaussian mean filtering
  • 7.Median filtering
F.AI Advanced Course (Ubuntu system)
  • 1. QR code
  • 2. Human posture estimation
  • 3. Target detection
  • 4. Mediapipe development
  • 5. yolov4-tiny
E.Install TensorFlow
  • Install TensorFlow
6.ROS1 coursenew
Basic Course
  • 1.ROS introduction
  • 2.Project file structure
  • 3.Common commands and tools
  • 4.Publisher
  • 5.Subscribers
  • 6.Customize topic messages and use
  • 7.Client
  • 8.Server
  • 9.Custom service messages and usage
  • 10.TF release and monitoring
Visual Image Processing
  • 1. AR vision
  • 2. AR QR code
  • 3. ROS+Opencv foundation
  • 4. ROS+Opencv application
  • 5. MediaPipe development
7.ROS2 coursenew
Docker Course
  • 1.Overview and installation
  • 2.Common commands
  • 3.Understand and publish images
  • 4.Hardware interaction data processing
  • 5.Enter docker container
  • 6.Update docker images
Basic Course
  • 1.Introduction to ROS2
  • 2.Commands and tools
  • 3.ROS2 Topic communications
  • 4.ROS2 service communications
  • 5.ROS2launch file starts
OpenCV Course
  • 1.OpenCV Basic Course
  • 2.ROS+opencv application
  • 3.QR code recognition
  • 4.AR Vision
  • 5.Mediapipe
8.Accessories installation
  • 1. Installation of heat sink
  • 2. Wiring of cooling fan
  • 3. Double fan armor case Installation
  • 4. Argon NEO aluminum case installation
  • 5. Argon ONE aluminum alloy case installation
  • 6. Metal shell with built-in fan installation
  • 7. Acrylic case with cooling fan installation
  • 8. White-red ABS protective case installation
Download
  • Tools
  • C_code
  • Python code
  • ROS System
Download ZIP

Welcome to Raspberry Pi 4B repository

2.Commands and tools

Common commands and tools for ROS2

1、Package management tool ros2 pkg

1.1、ros2 pkg create

Function: To create a function package, you need to specify the package name, compilation mode, dependencies, etc. when creating it.

Command format:ros2 pkg create --build-type ament_python pkg_name rclpy std_msgs sensor_msgs

ros2 pkg create:Instructions for creating packages

--build-type:If the newly created feature pack uses C++ or C, then write ament_cmake here, and if you use Python, write ament_python

pkg_name:Create a name for the feature pack

rclpy std_msgs sensor_msgs:These are some compilation dependencies

1.2、ros2 pkg list

Features: View the list of feature packs in your system

Command format:ros2 pkg list

image-20230427154146879

1.3、ros2 pkg executeables

Command function: View the list of executable files in the package

Command format: ros2 pkg executables pkg_name

image-20230427154419005

2、The node runs ROS2 run

  • Command function: Run the feature pack node program

    Command format:ros2 run pkg_name node_name

    • pkg_name:Feature pack name
    • node_name:The name of the executable program

image-20230427155359745

3、Node-related tools ros2 node

3.1、ros2 node list

Command function: Lists all node names in the current domain

Command format: ros2 node list

image-20230427155655753

3.2、ros2 node info

Command function: View node details, including subscriptions, published messages, enabled services, and actions

Command format: ros2 node info node_name

  • node_name:The name of the node that needs to be viewed

image-20230427160001101

4、Topic-related tools ros2 topic

4.1、ros2 topic list

Command function: Lists all topics in the current domain

Command format: ros2 topic list

image-20230427160351051

4.2、ros2 topic info

Command function: Displays the topic message type, number of subscribers/publishers

Command format: ros2 topic info topic_name

  • topic_name:The name of the topic that needs to be queried

image-20230427160625594

4.3、ros2 topic type

Command function: View the message type of the thread

Command format: ros2 topic type topic_name

  • topic_name:You need to look up the name of the topic type

image-20230427161056536

4.4、ros2 topic hz

Command function: Displays the average publishing frequency of the topic

Command format: ros2 topic hz topic_name

  • topic_name:Need to query the name of the topic frequency

image-20230427161721650

4.5、ros2 topic echo

Command function: Print topic messages in the terminal, similar to a subscriber

Command format: ros2 topic echo topic_name

  • topic_name:The name of the topic on which the message needs to be printed

image-20230427162312888

4.5、ros2 topic pub

Command function: Publish a specified topic message in the terminal

Command format: ros2 topic pub topic_name message_type message_content

  • topic_name:The name of the topic that needs to post the thread message
  • message_type:The data type of the topic
  • message_content:Message content

The default is to cycle the release at a frequency of 1Hz, and the following parameters can be set:

  • Parameter -1 is published only once:

    ros2 topic pub -1 topic_name message_type message_content

  • The parameter -t count loops the end of the release count:

    ros2 topic pub -t count topic_name message_type message_content

  • The parameter -r count is cycled at the frequency of count Hz:

    ros2 topic pub -r count topic_name message_type message_content

ros2 topic pub turtle1/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.5, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.2}}"

It should be noted here that there is a space after the colon.

 

5、Interface-related tools ros2 interface

5.1、ros2 interface list

Command function: lists all interfaces of the current system, including topics, services, and actions.

Command format: ros2 interface list

image-20230427164755075

5.2、ros2 interface show

Command function: Displays the details of the specified interface

Command format: ros2 interface show interface_name

  • interface_name:The name of the interface content to be displayed

image-20230427165057647

6、Service-related tool ros2 service

6.1、ros2 service list

Command function: lists all services in the current domain

Command format: ros2 interface show interface_name

image-20230427172236875

6.2、ros2 service call

Command function: Invoke the specified service

Command format: ros2 interface call service_name service_Type arguments

  • service_name:The service that needs to be called
  • service_Type:Service data type
  • arguments:Provide the parameters required for the service

For example: call the Build Turtle service

xxxxxxxxxx
ros2 service call /spawn turtlesim/srv/Spawn "{x: 2, y: 2, theta: 0.2, name: ''}"
requester: making request: turtlesim.srv.Spawn_Request(x=2.0, y=2.0, theta=0.2, name='turtle2')

image-20230427173625631

7、rqt_image_view

rosrun rqt_image_view rqt_image_view

rqt_image_view can be used to view images, if there is published image topic data in the current domain, you can use this tool to view images.

xxxxxxxxxx
ros2 run rqt_image_view rqt_image_view

image-20230427192305253

Image data is displayed by the image topic selected in the upper-left corner.

8、rqt_graph

rqt_graph can be used to view which nodes are running in the current domain and the topic communication between nodes, use the following command to open:

xxxxxxxxxx
ros2 run run rqt_graph rqt_graph

image-20230427192536559

9、rviz2

The core framework of Rviz is an open platform based on Qt visualization tools, and you can see the graphical effect according to the corresponding topic of news release in ROS. In ROS2, launch the rviz tool using rviz2.

xxxxxxxxxx
rviz2

image-20230427191933170

Through the above steps, you can add visual data through plugins or through topics, generally choosing to add through topics.

10、tf2_tools

tf2_tools You can view the current TF tree, and a frame.pdf file will be generated under the terminal where the command is entered.

xxxxxxxxxx
ros2 run tf2_tools view_frames.py

 

Introduction to ROS2
ROS2 Topic communications

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文