Skip to content

Commit 9f054f1

Browse files
authored
update turtlesim_msgs (ros2#4562)
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
1 parent 30fd040 commit 9f054f1

File tree

12 files changed

+62
-62
lines changed

12 files changed

+62
-62
lines changed

source/Tutorials/Advanced/Reading-From-A-Bag-File-CPP.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Inside your package's ``src`` directory, create a new file called ``simple_bag_r
7575
#include "rclcpp/rclcpp.hpp"
7676
#include "rclcpp/serialization.hpp"
7777
#include "rosbag2_transport/reader_writer_factory.hpp"
78-
#include "turtlesim/msg/pose.hpp"
78+
#include "turtlesim_msgs/msg/pose.hpp"
7979

8080
using namespace std::chrono_literals;
8181

@@ -85,7 +85,7 @@ Inside your package's ``src`` directory, create a new file called ``simple_bag_r
8585
PlaybackNode(const std::string & bag_filename)
8686
: Node("playback_node")
8787
{
88-
publisher_ = this->create_publisher<turtlesim::msg::Pose>("/turtle1/pose", 10);
88+
publisher_ = this->create_publisher<turtlesim_msgs::msg::Pose>("/turtle1/pose", 10);
8989

9090
timer_ = this->create_wall_timer(100ms,
9191
[this](){return this->timer_callback();}
@@ -108,7 +108,7 @@ Inside your package's ``src`` directory, create a new file called ``simple_bag_r
108108
}
109109

110110
rclcpp::SerializedMessage serialized_msg(*msg->serialized_data);
111-
turtlesim::msg::Pose::SharedPtr ros_msg = std::make_shared<turtlesim::msg::Pose>();
111+
turtlesim_msgs::msg::Pose::SharedPtr ros_msg = std::make_shared<turtlesim_msgs::msg::Pose>();
112112
113113
serialization_.deserialize_message(&serialized_msg, ros_msg.get());
114114

@@ -120,9 +120,9 @@ Inside your package's ``src`` directory, create a new file called ``simple_bag_r
120120
}
121121

122122
rclcpp::TimerBase::SharedPtr timer_;
123-
rclcpp::Publisher<turtlesim::msg::Pose>::SharedPtr publisher_;
123+
rclcpp::Publisher<turtlesim_msgs::msg::Pose>::SharedPtr publisher_;
124124

125-
rclcpp::Serialization<turtlesim::msg::Pose> serialization_;
125+
rclcpp::Serialization<turtlesim_msgs::msg::Pose> serialization_;
126126
std::unique_ptr<rosbag2_cpp::Reader> reader_;
127127
};
128128

@@ -162,7 +162,7 @@ Note the constructor takes a path to the bag file as a parameter.
162162
PlaybackNode(const std::string & bag_filename)
163163
: Node("playback_node")
164164
{
165-
publisher_ = this->create_publisher<turtlesim::msg::Pose>("/turtle1/pose", 10);
165+
publisher_ = this->create_publisher<turtlesim_msgs::msg::Pose>("/turtle1/pose", 10);
166166

167167
timer_ = this->create_wall_timer(100ms,
168168
[this](){return this->timer_callback();}
@@ -199,7 +199,7 @@ Then, we can pass both these objects to the ``rclcpp::Serialization::deserialize
199199
.. code-block:: C++
200200

201201
rclcpp::SerializedMessage serialized_msg(*msg->serialized_data);
202-
turtlesim::msg::Pose::SharedPtr ros_msg = std::make_shared<turtlesim::msg::Pose>();
202+
turtlesim_msgs::msg::Pose::SharedPtr ros_msg = std::make_shared<turtlesim_msgs::msg::Pose>();
203203
204204
serialization_.deserialize_message(&serialized_msg, ros_msg.get());
205205

@@ -219,9 +219,9 @@ We must also declare the private variables used throughout the node.
219219
.. code-block:: C++
220220

221221
rclcpp::TimerBase::SharedPtr timer_;
222-
rclcpp::Publisher<turtlesim::msg::Pose>::SharedPtr publisher_;
222+
rclcpp::Publisher<turtlesim_msgs::msg::Pose>::SharedPtr publisher_;
223223

224-
rclcpp::Serialization<turtlesim::msg::Pose> serialization_;
224+
rclcpp::Serialization<turtlesim_msgs::msg::Pose> serialization_;
225225
std::unique_ptr<rosbag2_cpp::Reader> reader_;
226226
};
227227

source/Tutorials/Beginner-CLI-Tools/Recording-And-Playing-Back-Data/Recording-And-Playing-Back-Data.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Running this command on the ``subset`` bag file will return a list of informatio
227227
End Oct 11 2019 06:09:57.60 (1570799397.60)
228228
Messages: 3013
229229
Topic information: Topic: /turtle1/cmd_vel | Type: geometry_msgs/msg/Twist | Count: 9 | Serialization Format: cdr
230-
Topic: /turtle1/pose | Type: turtlesim/msg/Pose | Count: 3004 | Serialization Format: cdr
230+
Topic: /turtle1/pose | Type: turtlesim_msgs/msg/Pose | Count: 3004 | Serialization Format: cdr
231231
232232
5 Play topic data
233233
^^^^^^^^^^^^^^^^^

source/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Actions/Understanding-ROS2-Actions.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,16 @@ Which will return a list of ``/turtlesim``'s subscribers, publishers, services,
131131
Publishers:
132132
/parameter_events: rcl_interfaces/msg/ParameterEvent
133133
/rosout: rcl_interfaces/msg/Log
134-
/turtle1/color_sensor: turtlesim/msg/Color
135-
/turtle1/pose: turtlesim/msg/Pose
134+
/turtle1/color_sensor: turtlesim_msgs/msg/Color
135+
/turtle1/pose: turtlesim_msgs/msg/Pose
136136
Service Servers:
137137
/clear: std_srvs/srv/Empty
138-
/kill: turtlesim/srv/Kill
138+
/kill: turtlesim_msgs/srv/Kill
139139
/reset: std_srvs/srv/Empty
140-
/spawn: turtlesim/srv/Spawn
141-
/turtle1/set_pen: turtlesim/srv/SetPen
142-
/turtle1/teleport_absolute: turtlesim/srv/TeleportAbsolute
143-
/turtle1/teleport_relative: turtlesim/srv/TeleportRelative
140+
/spawn: turtlesim_msgs/srv/Spawn
141+
/turtle1/set_pen: turtlesim_msgs/srv/SetPen
142+
/turtle1/teleport_absolute: turtlesim_msgs/srv/TeleportAbsolute
143+
/turtle1/teleport_relative: turtlesim_msgs/srv/TeleportRelative
144144
/turtlesim/describe_parameters: rcl_interfaces/srv/DescribeParameters
145145
/turtlesim/get_parameter_types: rcl_interfaces/srv/GetParameterTypes
146146
/turtlesim/get_parameters: rcl_interfaces/srv/GetParameters
@@ -150,7 +150,7 @@ Which will return a list of ``/turtlesim``'s subscribers, publishers, services,
150150
Service Clients:
151151
152152
Action Servers:
153-
/turtle1/rotate_absolute: turtlesim/action/RotateAbsolute
153+
/turtle1/rotate_absolute: turtlesim_msgs/action/RotateAbsolute
154154
Action Clients:
155155
156156
Notice that the ``/turtle1/rotate_absolute`` action for ``/turtlesim`` is under ``Action Servers``.
@@ -186,7 +186,7 @@ Which will return:
186186
Action Servers:
187187
188188
Action Clients:
189-
/turtle1/rotate_absolute: turtlesim/action/RotateAbsolute
189+
/turtle1/rotate_absolute: turtlesim_msgs/action/RotateAbsolute
190190
191191
4 ros2 action list
192192
^^^^^^^^^^^^^^^^^^
@@ -221,9 +221,9 @@ Which will return:
221221

222222
.. code-block:: console
223223
224-
/turtle1/rotate_absolute [turtlesim/action/RotateAbsolute]
224+
/turtle1/rotate_absolute [turtlesim_msgs/action/RotateAbsolute]
225225
226-
In brackets to the right of each action name (in this case only ``/turtle1/rotate_absolute``) is the action type, ``turtlesim/action/RotateAbsolute``.
226+
In brackets to the right of each action name (in this case only ``/turtle1/rotate_absolute``) is the action type, ``turtlesim_msgs/action/RotateAbsolute``.
227227
You will need this when you want to execute an action from the command line or from code.
228228

229229
5 ros2 action type
@@ -239,7 +239,7 @@ Which will return:
239239

240240
.. code-block:: console
241241
242-
turtlesim/action/RotateAbsolute
242+
turtlesim_msgs/action/RotateAbsolute
243243
244244
6 ros2 action info
245245
^^^^^^^^^^^^^^^^^^
@@ -273,7 +273,7 @@ Enter the following command with the action type in your terminal:
273273

274274
.. code-block:: console
275275
276-
ros2 interface show turtlesim/action/RotateAbsolute
276+
ros2 interface show turtlesim_msgs/action/RotateAbsolute
277277
278278
Which will return:
279279

@@ -307,7 +307,7 @@ Keep an eye on the turtlesim window, and enter the following command into your t
307307

308308
.. code-block:: console
309309
310-
ros2 action send_goal /turtle1/rotate_absolute turtlesim/action/RotateAbsolute "{theta: 1.57}"
310+
ros2 action send_goal /turtle1/rotate_absolute turtlesim_msgs/action/RotateAbsolute "{theta: 1.57}"
311311
312312
You should see the turtle rotating, as well as the following message in your terminal:
313313

@@ -331,7 +331,7 @@ To see the feedback of this goal, add ``--feedback`` to the ``ros2 action send_g
331331

332332
.. code-block:: console
333333
334-
ros2 action send_goal /turtle1/rotate_absolute turtlesim/action/RotateAbsolute "{theta: -1.57}" --feedback
334+
ros2 action send_goal /turtle1/rotate_absolute turtlesim_msgs/action/RotateAbsolute "{theta: -1.57}" --feedback
335335
336336
Your terminal will return the message:
337337

source/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Nodes/Understanding-ROS2-Nodes.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,26 +154,26 @@ The output should look like this:
154154
Publishers:
155155
/parameter_events: rcl_interfaces/msg/ParameterEvent
156156
/rosout: rcl_interfaces/msg/Log
157-
/turtle1/color_sensor: turtlesim/msg/Color
158-
/turtle1/pose: turtlesim/msg/Pose
157+
/turtle1/color_sensor: turtlesim_msgs/msg/Color
158+
/turtle1/pose: turtlesim_msgs/msg/Pose
159159
Service Servers:
160160
/clear: std_srvs/srv/Empty
161-
/kill: turtlesim/srv/Kill
161+
/kill: turtlesim_msgs/srv/Kill
162162
/my_turtle/describe_parameters: rcl_interfaces/srv/DescribeParameters
163163
/my_turtle/get_parameter_types: rcl_interfaces/srv/GetParameterTypes
164164
/my_turtle/get_parameters: rcl_interfaces/srv/GetParameters
165165
/my_turtle/list_parameters: rcl_interfaces/srv/ListParameters
166166
/my_turtle/set_parameters: rcl_interfaces/srv/SetParameters
167167
/my_turtle/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically
168168
/reset: std_srvs/srv/Empty
169-
/spawn: turtlesim/srv/Spawn
170-
/turtle1/set_pen: turtlesim/srv/SetPen
171-
/turtle1/teleport_absolute: turtlesim/srv/TeleportAbsolute
172-
/turtle1/teleport_relative: turtlesim/srv/TeleportRelative
169+
/spawn: turtlesim_msgs/srv/Spawn
170+
/turtle1/set_pen: turtlesim_msgs/srv/SetPen
171+
/turtle1/teleport_absolute: turtlesim_msgs/srv/TeleportAbsolute
172+
/turtle1/teleport_relative: turtlesim_msgs/srv/TeleportRelative
173173
Service Clients:
174174
175175
Action Servers:
176-
/turtle1/rotate_absolute: turtlesim/action/RotateAbsolute
176+
/turtle1/rotate_absolute: turtlesim_msgs/action/RotateAbsolute
177177
Action Clients:
178178
179179
Now try running the same command on the ``/teleop_turtle`` node, and see how its connections differ from ``my_turtle``.

source/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Services/Understanding-ROS2-Services.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ Which will return:
133133
.. code-block:: console
134134
135135
/clear [std_srvs/srv/Empty]
136-
/kill [turtlesim/srv/Kill]
136+
/kill [turtlesim_msgs/srv/Kill]
137137
/reset [std_srvs/srv/Empty]
138-
/spawn [turtlesim/srv/Spawn]
138+
/spawn [turtlesim_msgs/srv/Spawn]
139139
...
140-
/turtle1/set_pen [turtlesim/srv/SetPen]
141-
/turtle1/teleport_absolute [turtlesim/srv/TeleportAbsolute]
142-
/turtle1/teleport_relative [turtlesim/srv/TeleportRelative]
140+
/turtle1/set_pen [turtlesim_msgs/srv/SetPen]
141+
/turtle1/teleport_absolute [turtlesim_msgs/srv/TeleportAbsolute]
142+
/turtle1/teleport_relative [turtlesim_msgs/srv/TeleportRelative]
143143
...
144144
145145
4 ros2 service info
@@ -215,13 +215,13 @@ But, as you learned earlier, the ``Empty`` type doesn't send or receive any data
215215
So, naturally, its structure is blank.
216216

217217
Let's introspect a service with a type that sends and receives data, like ``/spawn``.
218-
From the results of ``ros2 service list -t``, we know ``/spawn``'s type is ``turtlesim/srv/Spawn``.
218+
From the results of ``ros2 service list -t``, we know ``/spawn``'s type is ``turtlesim_msgs/srv/Spawn``.
219219

220220
To see the request and response arguments of the ``/spawn`` service, run the command:
221221

222222
.. code-block:: console
223223
224-
ros2 interface show turtlesim/srv/Spawn
224+
ros2 interface show turtlesim_msgs/srv/Spawn
225225
226226
Which will return:
227227

@@ -266,7 +266,7 @@ Enter the command:
266266

267267
.. code-block:: console
268268
269-
ros2 service call /spawn turtlesim/srv/Spawn "{x: 2, y: 2, theta: 0.2, name: ''}"
269+
ros2 service call /spawn turtlesim_msgs/srv/Spawn "{x: 2, y: 2, theta: 0.2, name: ''}"
270270
271271
You will get this method-style view of what's happening, and then the service response:
272272

source/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Topics/Understanding-ROS2-Topics.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ Running the ``ros2 topic list`` command in a new terminal will return a list of
111111
/parameter_events [rcl_interfaces/msg/ParameterEvent]
112112
/rosout [rcl_interfaces/msg/Log]
113113
/turtle1/cmd_vel [geometry_msgs/msg/Twist]
114-
/turtle1/color_sensor [turtlesim/msg/Color]
115-
/turtle1/pose [turtlesim/msg/Pose]
114+
/turtle1/color_sensor [turtlesim_msgs/msg/Color]
115+
/turtle1/pose [turtlesim_msgs/msg/Pose]
116116
117117
These attributes, particularly the type, are how nodes know they're talking about the same information as it moves over topics.
118118

source/Tutorials/Intermediate/Launch/Using-Event-Handlers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Create a new file called ``example_event_handlers_launch.py`` file in the ``laun
8989
' service call ',
9090
turtlesim_ns,
9191
'/spawn ',
92-
'turtlesim/srv/Spawn ',
92+
'turtlesim_msgs/srv/Spawn ',
9393
'"{x: 2, y: 2, theta: 0.2}"'
9494
]],
9595
shell=True

source/Tutorials/Intermediate/Launch/Using-Substitutions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Now create the substitution launch file in the same folder:
281281
'ros2 service call ',
282282
turtlesim_ns,
283283
'/spawn ',
284-
'turtlesim/srv/Spawn ',
284+
'turtlesim_msgs/srv/Spawn ',
285285
'"{x: 2, y: 2, theta: 0.2}"'
286286
]],
287287
shell=True
@@ -374,7 +374,7 @@ Now create the substitution launch file in the same folder:
374374
'ros2 service call ',
375375
turtlesim_ns,
376376
'/spawn ',
377-
'turtlesim/srv/Spawn ',
377+
'turtlesim_msgs/srv/Spawn ',
378378
'"{x: 2, y: 2, theta: 0.2}"'
379379
]],
380380
shell=True
@@ -436,7 +436,7 @@ Now create the substitution launch file in the same folder:
436436
exec: 'turtlesim_node'
437437
name: 'sim'
438438
- executable:
439-
cmd: 'ros2 service call $(var turtlesim_ns)/spawn turtlesim/srv/Spawn "{x: 5, y: 2, theta: 0.2}"'
439+
cmd: 'ros2 service call $(var turtlesim_ns)/spawn turtlesim_msgs/srv/Spawn "{x: 5, y: 2, theta: 0.2}"'
440440
- executable:
441441
cmd: 'ros2 param set $(var turtlesim_ns)/sim background_r 120'
442442
- timer:
@@ -482,7 +482,7 @@ Now create the substitution launch file in the same folder:
482482
.. code-block:: yaml
483483
484484
- executable:
485-
cmd: 'ros2 service call $(var turtlesim_ns)/spawn turtlesim/srv/Spawn "{x: 5, y: 2, theta: 0.2}"'
485+
cmd: 'ros2 service call $(var turtlesim_ns)/spawn turtlesim_msgs/srv/Spawn "{x: 5, y: 2, theta: 0.2}"'
486486
487487
The same approach is used for the ``ros2 param`` ``executable`` actions that change the turtlesim background's red color parameter.
488488
The difference is that the second action inside of the timer is only executed if the provided ``new_background_r`` argument equals ``200`` and the ``use_provided_red`` launch argument is set to ``True``.

source/Tutorials/Intermediate/Tf2/Using-Stamped-Datatypes-With-Tf2-Ros-MessageFilter.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Open the file using your preferred text editor.
121121
else:
122122
if self.spawner.service_is_ready():
123123
# Initialize request with turtle name and coordinates
124-
# Note that x, y and theta are defined as floats in turtlesim/srv/Spawn
124+
# Note that x, y and theta are defined as floats in turtlesim_msgs/srv/Spawn
125125
request = Spawn.Request()
126126
request.name = 'turtle3'
127127
request.x = 4.0
@@ -174,7 +174,7 @@ First, in the ``on_timer`` callback function, we spawn the ``turtle3`` by asynch
174174
.. code-block:: python
175175
176176
# Initialize request with turtle name and coordinates
177-
# Note that x, y and theta are defined as floats in turtlesim/srv/Spawn
177+
# Note that x, y and theta are defined as floats in turtlesim_msgs/srv/Spawn
178178
request = Spawn.Request()
179179
request.name = 'turtle3'
180180
request.x = 4.0

source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Cpp.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Open the file using your preferred text editor.
8080
#include "rclcpp/rclcpp.hpp"
8181
#include "tf2/LinearMath/Quaternion.h"
8282
#include "tf2_ros/transform_broadcaster.h"
83-
#include "turtlesim/msg/pose.hpp"
83+
#include "turtlesim_msgs/msg/pose.hpp"
8484

8585
class FramePublisher : public rclcpp::Node
8686
{
@@ -101,7 +101,7 @@ Open the file using your preferred text editor.
101101
stream << "/" << turtlename_.c_str() << "/pose";
102102
std::string topic_name = stream.str();
103103

104-
auto handle_turtle_pose = [this](const std::shared_ptr<turtlesim::msg::Pose> msg){
104+
auto handle_turtle_pose = [this](const std::shared_ptr<turtlesim_msgs::msg::Pose> msg){
105105
geometry_msgs::msg::TransformStamped t;
106106

107107
// Read message content and assign it to
@@ -129,13 +129,13 @@ Open the file using your preferred text editor.
129129
// Send the transformation
130130
tf_broadcaster_->sendTransform(t);
131131
};
132-
subscription_ = this->create_subscription<turtlesim::msg::Pose>(
132+
subscription_ = this->create_subscription<turtlesim_msgs::msg::Pose>(
133133
topic_name, 10,
134134
handle_turtle_pose);
135135
}
136136

137137
private:
138-
rclcpp::Subscription<turtlesim::msg::Pose>::SharedPtr subscription_;
138+
rclcpp::Subscription<turtlesim_msgs::msg::Pose>::SharedPtr subscription_;
139139
std::unique_ptr<tf2_ros::TransformBroadcaster> tf_broadcaster_;
140140
std::string turtlename_;
141141
};
@@ -162,7 +162,7 @@ Afterward, the node subscribes to topic ``turtleX/pose`` and runs function ``han
162162

163163
.. code-block:: C++
164164

165-
subscription_ = this->create_subscription<turtlesim::msg::Pose>(
165+
subscription_ = this->create_subscription<turtlesim_msgs::msg::Pose>(
166166
topic_name, 10,
167167
handle_turtle_pose);
168168

0 commit comments

Comments
 (0)