Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
Marco A. Gutierrez 0f3071f88c | 1 week ago | |
---|---|---|
.. | ||
demo_nodes_py | 4 months ago | |
img | 1 year ago | |
resource | 6 years ago | |
test | 4 years ago | |
CHANGELOG.rst | 1 week ago | |
README.md | 1 year ago | |
package.xml | 1 week ago | |
setup.cfg | 3 years ago | |
setup.py | 1 week ago |
This package contains the following ROS 2 nodes:
listener
talker
add_two_ints_client
add_two_ints_server
set_parameters_callback
add_two_ints_client_async
listener_qos
talker_qos
listerner_serialized
async_param_client
Run this command to build the package:
colcon build --packages-select demo_nodes_py
This runs talker
and listener
ROS 2 nodes which exchange the following string with incremeting integer:
Hello World: <count_>
# Open new terminal
ros2 run demo_nodes_py talker
# Open new terminal
ros2 run demo_nodes_py listener
This runs add_two_ints_client
and add_two_ints_server
ROS 2 client and server where the server processes two integers sent from the client and publishes its sum to the client to be printed out.
# Open new terminal
ros2 run demo_nodes_py add_two_ints_server
# Open new terminal
ros2 run demo_nodes_py add_two_ints_client
# Open new terminal
ros2 run demo_nodes_py add_two_ints_client_async
Similar to previous, this runs talker_qos
and listener_qos
ROS 2 nodes which exchange messages using the Quality of Service (QoS) best effort policy.
# Open new terminal
ros2 run demo_nodes_py talker_qos
# Open new terminal
ros2 run demo_nodes_py listener_qos
This runs set_parameters_callback
ROS 2 node which triggers a callback when ROS 2 double parameter param1
is set. The callback then sets ROS 2 double parameter param2
to a fixed 4.0
:
# Open new terminal
ros2 run demo_nodes_py set_parameters_callback
This runs async_param_client
ROS 2 node which demonstrates how to set, list, get, load and delete parameters from the parameter blackboard in an asynchronous manner:
# Open new terminal
ros2 run demo_nodes_cpp parameter_blackboard
For more details on parameter_blackboard, please refer to demo_nodes_cpp README.md.
# Open new terminal
ros2 run demo_nodes_py async_param_client
This runs serialized_subscriber
ROS 2 node that subscribes to the ROS 2 topic, /chatter
, and deserializes as well as prints out received strings:
# Open new terminal
ros2 run demo_nodes_py listener_serialized
When executed correctly, strings should be printed to the terminal similar to what is shown below:
# In terminal running talker
[INFO] [1674573022.635075580] [talker]: Publishing: "Hello World: 0"
[INFO] [1674573023.593075728] [talker]: Publishing: "Hello World: 1"
[INFO] [1674573024.592438479] [talker]: Publishing: "Hello World: 2"
# In terminal running listener
[INFO] [1674573025.634810166] [listener]: I heard: [Hello World: 0]
[INFO] [1674573026.596392653] [listener]: I heard: [Hello World: 1]
[INFO] [1674573027.596400384] [listener]: I heard: [Hello World: 2]
#...
When executed correctly, strings should be printed to the terminal similar to what is shown below:
# In terminal running add_two_ints_server
[INFO] [1674553268.912391774] [add_two_ints_server]: Incoming request
a: 2 b: 3
# In terminal running add_two_ints_client
[INFO] [1674553268.912602310] [add_two_ints_client]: Result of add_two_ints: 5
# In terminal running add_two_ints_client_async
[INFO] [1674553718.598690033] [add_two_ints_client]: Result of add_two_ints: 5
When executed correctly, strings should be printed to the terminal similar to what is shown below:
# In terminal running talker_qos
[INFO] [1674572630.018298164] [talker_qos]: Best effort talker
[INFO] [1674572631.021168516] [talker_qos]: Publishing: "Hello World: 0"
[INFO] [1674572632.021072723] [talker_qos]: Publishing: "Hello World: 1"
[INFO] [1674572633.021197421] [talker_qos]: Publishing: "Hello World: 2"
#...
# In terminal running listener_qos
[INFO] [1674572639.695289182] [listener_qos]: Best effort listener
[INFO] [1674572640.023684925] [listener_qos]: I heard: [Hello World: 0]
[INFO] [1674572641.023416691] [listener_qos]: I heard: [Hello World: 1]
[INFO] [1674572642.024505343] [listener_qos]: I heard: [Hello World: 2]
#...
Run ros2 param get /set_parameters_callback param1
should print the following to the terminal:
Double value is: 0.0
Run ros2 param get /set_parameters_callback param2
should print the following to the terminal:
Double value is 0.0
Run ros2 param set /set_parameters_callback param1 28.0
should print the following to the terminal:
Set parameter successful
Run ros2 param get /set_parameters_callback param1
should print the following to the terminal:
Double value is: 28.0
Run ros2 param get /set_parameters_callback param2
should print the following to the terminal:
Double value is 4.0
Running ros2 run demo_nodes_cpp parameter_blackboard
should print the output to the terminal similar to what is shown below:
# In terminal running async_param_client
[INFO] [1674574042.977327137] [async_param_client]: Setting parameters:
[INFO] [1674574042.978217825] [async_param_client]: int_parameter:
[INFO] [1674574042.978474500] [async_param_client]: successful: True
[INFO] [1674574042.978718655] [async_param_client]: bool_parameter:
[INFO] [1674574042.978960532] [async_param_client]: successful: True
[INFO] [1674574042.979200840] [async_param_client]: string_parameter:
[INFO] [1674574042.979446692] [async_param_client]: successful: True
[INFO] [1674574042.979687030] [async_param_client]: Listing Parameters:
[INFO] [1674574042.980229123] [async_param_client]: - bool_parameter
[INFO] [1674574042.980476617] [async_param_client]: - int_parameter
[INFO] [1674574042.980717248] [async_param_client]: - string_parameter
[INFO] [1674574042.980956813] [async_param_client]: Getting parameters:
[INFO] [1674574042.981544032] [async_param_client]: - int_parameter: 10
[INFO] [1674574042.981794832] [async_param_client]: - bool_parameter: False
[INFO] [1674574042.982038493] [async_param_client]: - string_parameter: Fee Fi Fo Fum
[INFO] [1674574042.982281892] [async_param_client]: Loading parameters:
[INFO] [1674574042.987160462] [async_param_client]: other_int_parameter:
[INFO] [1674574042.987431457] [async_param_client]: successful: True
[INFO] [1674574042.987679192] [async_param_client]: value: 0
[INFO] [1674574042.987920948] [async_param_client]: int_parameter:
[INFO] [1674574042.988162645] [async_param_client]: successful: True
[INFO] [1674574042.988402691] [async_param_client]: value: 12
[INFO] [1674574042.988643394] [async_param_client]: string_parameter:
[INFO] [1674574042.988884034] [async_param_client]: successful: True
[INFO] [1674574042.989125729] [async_param_client]: value: I smell the blood of an Englishman
[INFO] [1674574042.989365771] [async_param_client]: other_string_parameter:
[INFO] [1674574042.989605537] [async_param_client]: successful: True
[INFO] [1674574042.989847066] [async_param_client]: value: One fish, two fish, Red fish, blue fish
[INFO] [1674574042.990086215] [async_param_client]: bool_parameter:
[INFO] [1674574042.990325361] [async_param_client]: successful: True
[INFO] [1674574042.990565005] [async_param_client]: value: False
[INFO] [1674574042.990804701] [async_param_client]: Deleting parameters:
[INFO] [1674574042.991497679] [async_param_client]: other_int_parameter:
[INFO] [1674574042.991746545] [async_param_client]: successful: True
[INFO] [1674574042.991986980] [async_param_client]: reason:
[INFO] [1674574042.992226951] [async_param_client]: other_string_parameter:
[INFO] [1674574042.992465274] [async_param_client]: successful: True
[INFO] [1674574042.992703259] [async_param_client]: reason:
[INFO] [1674574042.992941566] [async_param_client]: string_parameter:
[INFO] [1674574042.993179508] [async_param_client]: successful: True
[INFO] [1674574042.993416599] [async_param_client]: reason:
Running ros2 run demo_nodes_py talker
should print output to the terminal similar to the following:
# In terminal running listener_serialized
[INFO] [1674574499.556053634] [serialized_subscriber]: I heard: "b'\x00\x01\x00\x00\x0f\x00\x00\x00Hello World: 0\x00\x00'"
[INFO] [1674574500.506343148] [serialized_subscriber]: I heard: "b'\x00\x01\x00\x00\x0f\x00\x00\x00Hello World: 1\x00\x00'"
[INFO] [1674574501.508214693] [serialized_subscriber]: I heard: "b'\x00\x01\x00\x00\x0f\x00\x00\x00Hello World: 2\x00\x00'"
No Description
C++ Python Text C Markdown other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》