[joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic...
Im using the below python launch file:
#!/usr/bin/env python3
import os
import sys
from ament_index_python.packages import get_package_share_directory
import rclpy
from rclpy.node import Node
from std_msgs.msg import String
import launch
import launch_ros.actions
from launch import LaunchDescription
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
def generate_launch_description():
# Load the URDF into a parameter
bringup_dir = get_package_share_directory('urdfpublisher')
urdf_path = os.path.join(bringup_dir, 'urdf', 'doggo.urdf')
urdf = open(urdf_path).read()
return launch.LaunchDescription([
launch_ros.actions.Node(
name='robot_state_publisher',
package='robot_state_publisher',
executable='robot_state_publisher',
parameters=[{'robot_description': urdf}],
),
launch_ros.actions.Node(
name='joint_state_publisher',
package='joint_state_publisher',
executable='joint_state_publisher',
parameters=[{'use_gui': True}],
)
])
def main(argv=sys.argv[1:]):
"""Run lifecycle nodes via launch."""
ld = generate_launch_description()
ls = launch.LaunchService(argv=argv)
ls.include_launch_description(ld)
#launch robot_description topic
node = rclpy.create_node('robot_description')
publisher = node.create_publisher(generate_launch_description, 'robot_description', 10)
#Fails when generating launch description with joint state publisher here
publisher.publish(generate_launch_description)
#publisher = node.create_publisher(String, 'sos')
return ls.run()
if __name__ == '__main__':
main()
to try and publish robot_description and joint_state_publisher with GUI enabled but I get the error "[joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic..." thrown. When i remove joint_state_publisher, RVIZ2 is able to correctly pick up on robot_description meaning it should be getting published. The terminal logs also look nearly identical when joint_state_publisher is removed.
Launch file log with joint_state_publisher removed from "return launch.LaunchDescription" block:
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [7135]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link body_link had 0 children
[robot_state_publisher-1] [INFO] [1594658144.778155573] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1594658144.778254258] [robot_state_publisher]: got segment body_link
Launch file log when joint_state_publisher isn't removed
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [7078]
[INFO] [joint_state_publisher-2]: process started with pid [7080]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link body_link had 0 children
[robot_state_publisher-1] [INFO] [1594657967.525358734] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1594657967.525620189] [robot_state_publisher]: got segment body_link
[joint_state_publisher-2] [INFO] [1594657968.330320388] [joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic...
Not sure why joint_state_publisher is being finicky and the joint_state_publisher GitHub page doesn't have any .py launch file examples.