Getting no module found rosgraph error
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.substitutions import LaunchConfiguration, Command
from launch.actions import DeclareLaunchArgument
from launch_ros.actions import Node
import xacro
def generate_launch_description():
# Check if we're told to use sim time
use_sim_time = LaunchConfiguration('use_sim_time')
use_ros2_control = LaunchConfiguration('use_ros2_control')
# Process the URDF file
pkg_path = os.path.join(get_package_share_directory('my_bot'))
xacro_file = os.path.join(pkg_path,'description','robot.urdf.xacro')
# robot_description_config = xacro.process_file(xacro_file).toxml()
robot_description_config = Command(['xacro ', xacro_file, ' use_ros2_control:=', use_ros2_control])
# Create a robot_state_publisher node
params = {'robot_description': robot_description_config, 'use_sim_time': use_sim_time}
node_robot_state_publisher = Node(
package='robot_state_publisher',
executable='robot_state_publisher',
output='screen',
parameters=[params]
)
# Launch!
return LaunchDescription([
DeclareLaunchArgument(
'use_sim_time',
default_value='false',
description='Use sim time if true'),
DeclareLaunchArgument(
'use_ros2_control',
default_value='true',
description='Use ros2_control if true'),
node_robot_state_publisher
])
This is my code and the error log is [INFO] [launch]: All log files can be found below /home/dango/.ros/log/2023-07-19-16-20-18-312697-dango-24227 [INFO] [launch]: Default logging verbosity is set to INFO [ERROR] [launch]: Caught exception in launch (see debug for traceback): executed command failed. Command: xacro /home/dango/Desktop/devws/install/mybot/share/mybot/description/robot.urdf.xacro useros2_control:=true Captured stderr output: warning: No module named 'rosgraph' Usage: xacro [options]
xacro: error: expected exactly one input file as argument I get this error with I try to launch the launch file I am using ros2 humble in ubuntu mate 22
Asked by Pintu Bordoloi on 2023-07-19 06:02:14 UTC
Comments