-
I wanted to be able to launch rviz in addition to the webots simulation to interact with the model there. So I changed the robot_launch.py as follows:
When I colcon built the workspace containing webots_ros2_mavic and ran ros2 launch webots_ros2_mavic robot_launch.py, I got this error: As I understand it, the error is related with the way urdf file is written: there are no links in there only some device references. What should I do? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The robot_state_publisher needs the URDF of the robot as parameter to publish links over topics. Here you give the Command(['xacro ', LaunchConfiguration('model')]) xacro file, which doesn't seem to work. robot_state_publisher_node = launch_ros.actions.Node(
package='robot_state_publisher',
executable='robot_state_publisher',
parameters=[{'robot_description': '<robot name=""><link name=""/></robot>'}]
) mavic_driver = WebotsController(
robot_name='Mavic_2_PRO',
parameters=[
{'robot_description': robot_description_path,
'set_robot_state_publisher': True},
],
respawn=True
) |
Beta Was this translation helpful? Give feedback.
The robot_state_publisher needs the URDF of the robot as parameter to publish links over topics. Here you give the Command(['xacro ', LaunchConfiguration('model')]) xacro file, which doesn't seem to work.
What you can do is tell Webots to publish the URDF of the robot (with links and joints) in the background. You can inspire yourself from other examples like the tiago one for example. Here is the configuration you should use: