0
$\begingroup$

Rosanswers logo

Hello,
I have been searching but I haven't been able to find any similar questions with this error message.

My goal is to get you the rrbot up and running in Gazebo 11 using ros2_control.

However when I run my launch file I get the following error message:

parser error Couldn't parse params file: '--params-file /home/user/ros2_ws/install/my_robot_bringup/share/my_robot_bringup/config/controller_manager.yaml'. Error: Error openingYAML file.

Unfortunately the referenced path and file does not exist in my system, only this part exists:

/home/user/ros2_ws/install/my_robot_bringup/share/my_robot_bringup/ 

and this is missing (folder and yaml file do not exist in here):

config/controller_manager.yaml

I think that it has something to do with a missing statement in my CMakeLists.txt but I'm not sure how to correct this problem.

I really appreciate any help.

Roberto

If matters:

  • I'm on ROS2 Foxy.

My URDF ros2_control and plugin snippet:

  <ros2_control name="GazeboSystem" type="system">
    <hardware>
      <plugin>gazebo_ros2_control/GazeboSystem</plugin>
    </hardware>
    <joint name="joint1">
      <command_interface name="position">
        <param name="min">-6.28</param>
        <param name="max">6.28</param>
      </command_interface>
      <state_interface name="position"/>
      <state_interface name="velocity"/>
      <state_interface name="effort"/>
    </joint>
    <joint name="joint2">
      <command_interface name="position">
        <param name="min">-6.28</param>
        <param name="max">6.28</param>
      </command_interface>
      <state_interface name="position"/>
      <state_interface name="velocity"/>
      <state_interface name="effort"/>
    </joint>
  </ros2_control>

  <gazebo>
    <plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
      <robot_sim_type>gazebo_ros2_control/GazeboSystem</robot_sim_type>
      <parameters>$(find my_robot_bringup)/config/controller_manager.yaml</parameters>
    </plugin>
  </gazebo>

This is my CMakeLists.txt file:

cmake_minimum_required(VERSION 3.5)
project(my_robot_bringup)

if(NOT CMAKE_C_STANDARD)
  set(CMAKE_C_STANDARD 99)
endif()

if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclpy REQUIRED)
find_package(urdf REQUIRED)
find_package(xacro REQUIRED)
find_package(robot_state_publisher REQUIRED)


if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  ament_lint_auto_find_test_dependencies()
endif()

install( DIRECTORY launch DESTINATION share/${PROJECT_NAME}/ )

ament_python_install_package(${PROJECT_NAME})

install(PROGRAMS
  scripts/spawn_helper.py
  DESTINATION lib/${PROJECT_NAME}
)

ament_package()

And this is my controller_manager.yaml file:

controller_manager:
  ros__parameters:
    update_rate: 10  # Hz

    joint_state_broadcaster:
      type: joint_state_broadcaster/JointStateBroadcaster

    forward_position_controller:
      type: forward_command_controller/ForwardCommandController

    position_trajectory_controller:
      type: joint_trajectory_controller/JointTrajectoryController


forward_position_controller:
  ros__parameters:
    joints:
      - joint1
      - joint2
    interface_name: position


position_trajectory_controller:
  ros__parameters:
    joints:
      - joint1
      - joint2

    command_interfaces:
      - position

    state_interfaces:
      - position

    state_publish_rate: 200.0 # Defaults to 50
    action_monitor_rate: 20.0 # Defaults to 20

    allow_partial_joints_goal: false # Defaults to false
    open_loop_control: true
    allow_integration_in_goal_trajectories: true
    constraints:
      stopped_velocity_tolerance: 0.01 # Defaults to 0.01
      goal_time: 0.0 # Defaults to 0.0 (start immediately)

Originally posted by Roberto Z. on ROS Answers with karma: 500 on 2022-03-14

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You just need to modify install( DIRECTORY launch DESTINATION share/${PROJECT_NAME}/ ) to install( DIRECTORY launch config DESTINATION share/${PROJECT_NAME}/ )


Originally posted by Serafadam with karma: 170 on 2022-03-14

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Roberto Z. on 2022-03-14:
Many thanks @Serafadam, indeed that answers the problem.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.