ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Error at startup display.launch.py: cannot import name 'Command'

asked 2022-02-18 06:24:49 -0500

Dr.Modi gravatar image

Hello! I'm using Jetson Nano(JP4.6) With ROS 2 Eloquent. I built Nav2 from the source code, made a test description of URDF, but could not run display.launch.py . Here is the output I see when trying to run:

robot@robothost:~$ ros2 launch vector_description display.launch.py
[INFO] [launch]: All log files can be found below /home/robot/.ros/log/2022-02-18-14-13-30-610366-robothost-18354
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: cannot import name 'Command'

This is what the beginning looks like display.launch.py which I copied from the tutorial :

import launch
from launch.substitutions import Command, LaunchConfiguration
import launch_ros
import os

def generate_launch_description():
    pkg_share = launch_ros.substitutions.FindPackageShare(package='vector_description').find('vector_description')
    default_model_path = os.path.join(pkg_share, 'src/description/vector_description.urdf')
    default_rviz_config_path = os.path.join(pkg_share, 'rviz/urdf_config.rviz')

robot_state_publisher_node = launch_ros.actions.Node(
    package='robot_state_publisher',
    executable='robot_state_publisher',
    parameters=[{'robot_description': Command(['xacro ', LaunchConfiguration('model')])}]

Has anyone encountered this? How can I solve this problem?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-02-20 15:45:08 -0500

tnajjar gravatar image

It looks like Command is not in Eloquent. https://github.com/ros2/launch/tree/e...

It was added in Foxy. https://github.com/ros2/launch/blob/f...

edit flag offensive delete link more

Question Tools

Stats

Asked: 2022-02-18 06:24:49 -0500

Seen: 1,009 times

Last updated: Feb 20 '22