Browse Source

Use forward slash as it is default way of defining ros2 topic

tags/v0.3.2-rc2
haixuanTao 2 years ago
parent
commit
c878862966
2 changed files with 3 additions and 5 deletions
  1. +2
    -4
      examples/python-ros2-dataflow/random_turtle.py
  2. +1
    -1
      libraries/extensions/ros2-bridge/python/src/lib.rs

+ 2
- 4
examples/python-ros2-dataflow/random_turtle.py View File

@@ -21,14 +21,12 @@ topic_qos = dora.experimental.ros2_bridge.Ros2QosPolicies(

# Create a publisher to cmd_vel topic
turtle_twist_topic = ros2_node.create_topic(
"/turtle1/cmd_vel", "geometry_msgs::Twist", topic_qos
"/turtle1/cmd_vel", "geometry_msgs/Twist", topic_qos
)
twist_writer = ros2_node.create_publisher(turtle_twist_topic)

# Create a listener to pose topic
turtle_pose_topic = ros2_node.create_topic(
"/turtle1/pose", "turtlesim::Pose", topic_qos
)
turtle_pose_topic = ros2_node.create_topic("/turtle1/pose", "turtlesim/Pose", topic_qos)
pose_reader = ros2_node.create_subscription(turtle_pose_topic)

# Create a dora node


+ 1
- 1
libraries/extensions/ros2-bridge/python/src/lib.rs View File

@@ -101,7 +101,7 @@ impl Ros2Node {
message_type: String,
qos: qos::Ros2QosPolicies,
) -> eyre::Result<Ros2Topic> {
let (namespace_name, message_name) = message_type.split_once("::").with_context(|| {
let (namespace_name, message_name) = message_type.split_once("/").with_context(|| {
format!(
"message type must be of form `package::type`, is `{}`",
message_type


Loading…
Cancel
Save