Thank you for your response. This is from a freshly restarted terminal:
user:~$ cd ros2_ws/
user:~/ros2_ws$ source /opt/ros/humble/setup.bash
user:~/ros2_ws$ colcon build --packages-select topics_quiz
Starting >>> topics_quiz
Finished <<< topics_quiz [2.02s]
Summary: 1 package finished [2.69s]
user:~/ros2_ws$ source ~/ros2_ws/install/setup.bash
user:~/ros2_ws$ ros2 launch topics_quiz topics_quiz.launch.py
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2024-02-21-13-59-57-038451-3_xterm-7428
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [topics_quiz_node-1]: process started with pid [7429]
[topics_quiz_node-1] [INFO] [1708523998.015842550] [topics_quiz_node]: Step 1 COMPLETE
[topics_quiz_node-1] [INFO] [1708523998.016742578] [topics_quiz_node]: Step 2: Rotating neg: 170.94650375553155
The launch file:
from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
return LaunchDescription([
Node(
package='topics_quiz',
executable='topics_quiz_node',
output='screen'),
])
The relevant sections of the setup.py:
from setuptools import setup
import os
from glob import glob
package_name = 'topics_quiz'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
(os.path.join('share', package_name), glob('launch/*.launch.py')),
],
install_requires=['setuptools'],
zip_safe=True,
maintainer='user',
maintainer_email='user@todo.todo',
description='TODO: Package description',
license='TODO: License declaration',
tests_require=['pytest'],
entry_points={
'console_scripts': [
'topics_quiz_node = topics_quiz.topics_quiz:main'
],
},
)
From another freshly restarted terminal, while the node is running:
user:~$ source /opt/ros/humble/setup.bashuser:~$ ros2 topic info -v /odom
Type: nav_msgs/msg/Odometry
Publisher count: 1
Node name: turtlebot3_diff_drive
Node namespace: /
Topic type: nav_msgs/msg/Odometry
Endpoint type: PUBLISHER
GID: 01.0f.72.a1.08.01.67.aa.01.00.00.00.00.00.67.03.00.00.00.00.00.00.00.00
QoS profile:
Reliability: RELIABLE
History (Depth): UNKNOWN
Durability: VOLATILE
Lifespan: Infinite
Deadline: Infinite
Liveliness: AUTOMATIC
Liveliness lease duration: Infinite
Subscription count: 1
Node name: topics_quiz_node
Maybe after staring at this for too long I am overlooking something, but to me the naming appears to be consistent.