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

Revision history [back]

click to hide/show revision 1
initial version

Hello there,

Thanks @gurselturkeri, for updating the launch file in the question, but I am sharing the details answer over here,

As @gurselturkeri suggested to installed joint_trajectory_controller, joint_state_broadcaster, controller_manager, joint-state-publisher-gui library.

I think you also need this below library for your yaml file to access gazebo controls. sudo apt-get install ros-humble-gazebo-ros2-control

About the Launch file, If you are using Ros2 Humble you need to correct

Node(
            package="controller_manager",
            executable="spawner",   # In place of spawner.py is for foxy
            arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
            ),
Node(
           package="controller_manager",
           executable="spawner",     # In place of spawner.py is for foxy
            arguments=["joint_trajectory_controller", "-c", "/controller_manager"],
            )

You can check every thing is working by executing the command into your terminal:

ros2 topic pub /joint_trajectory_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
  stamp:
    sec: 0
    nanosec: 0
  frame_id: ''
joint_names: ['joint_1','joint_2','joint_4']
points: [ {"positions":[-1.57,-0.59,-1.2]} ]"

feel free to drop a comment in case it is not working.

Thanks, Ranjit

Hello there,

Thanks @gurselturkeri, for updating the launch file in the question, but I am sharing the details answer over here,

As @gurselturkeri suggested to installed joint_trajectory_controller, joint_state_broadcaster, controller_manager, joint-state-publisher-gui library.

I think you also need this below library for your yaml file to access gazebo controls. sudo apt-get install ros-humble-gazebo-ros2-control

About the Launch file, If you are using Ros2 Humble you need to correct

Node(
            package="controller_manager",
            executable="spawner",   # In place of spawner.py is for foxy
            arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
            ),
Node(
           package="controller_manager",
           executable="spawner",     # In place of spawner.py is for foxy
            arguments=["joint_trajectory_controller", "-c", "/controller_manager"],
            )

You can check every thing is working by executing the command into your terminal:

ros2 topic pub /joint_trajectory_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
  stamp:
    sec: 0
    nanosec: 0
  frame_id: ''
joint_names: ['joint_1','joint_2','joint_4']
points: [ {"positions":[-1.57,-0.59,-1.2]} ]"

feel free to drop a comment in case it is not working.

Thanks, Ranjit

Hello there,

Thanks @gurselturkeri, for updating the launch file in the question, but I am sharing the details answer over here,

As @gurselturkeri suggested to installed joint_trajectory_controller, joint_state_broadcaster, controller_manager, joint-state-publisher-gui library.

I think you also need this below library to access gazebo controls. sudo apt-get install ros-humble-gazebo-ros2-control

About the Launch file, If you are using Ros2 Humble you need to correct

Node(
            package="controller_manager",
            executable="spawner",   # In place of spawner.py is for foxy
            arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
            ),
Node(
           package="controller_manager",
           executable="spawner",     # In place of spawner.py is for foxy
            arguments=["joint_trajectory_controller", "-c", "/controller_manager"],
            )

Note: spawner.py is for foxy and spawner only is for humble.

You can check every thing is working by executing the command into your terminal:

ros2 topic pub /joint_trajectory_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
  stamp:
    sec: 0
    nanosec: 0
  frame_id: ''
joint_names: ['joint_1','joint_2','joint_4']
points: [ {"positions":[-1.57,-0.59,-1.2]} ]"

feel free to drop a comment in case it is not working.

Thanks, Ranjit

Hello there,

Thanks @gurselturkeri, for updating the launch file in the question, but I am sharing the details answer over here,

As @gurselturkeri suggested to installed joint_trajectory_controller, joint_state_broadcaster, controller_manager, joint-state-publisher-gui library.

I think you also need this below library to access gazebo controls. sudo apt-get install ros-humble-gazebo-ros2-control

About the Launch file, If you are using Ros2 Humble you need to correct

Node(
            package="controller_manager",
            executable="spawner",   # In place of spawner.py is for foxy
            arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
            ),
Node(
           package="controller_manager",
           executable="spawner",     # In place of spawner.py is for foxy
            arguments=["joint_trajectory_controller", "-c", "/controller_manager"],
            )

Note: spawner.py is for foxy and spawner only is for humble.

You can check every thing is working by executing the command into your terminal:

ros2 topic pub /joint_trajectory_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
  stamp:
    sec: 0
    nanosec: 0
  frame_id: ''
joint_names: ['joint_1','joint_2','joint_4']
points: [ {"positions":[-1.57,-0.59,-1.2]} ]"

feel free to drop a comment in case it is not working.

Thanks, Ranjit

Hello there,

Thanks @gurselturkeri, for updating the launch file in the question, but I am sharing the details answer over here,

As @gurselturkeri suggested to installed joint_trajectory_controller, joint_state_broadcaster, controller_manager, joint-state-publisher-gui library.

I think you also need this below library to access gazebo controls. sudo apt-get install ros-humble-gazebo-ros2-control

About the Launch file, If you are using Ros2 Humble you need to correct

Node(
            package="controller_manager",
            executable="spawner",   # In place of spawner.py is for foxy
             arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
            ),
Node(
           package="controller_manager",
           executable="spawner",     # In place of spawner.py is for foxy
             arguments=["joint_trajectory_controller", "-c", "/controller_manager"],
            )

You can check every thing is working by executing the command into your terminal:

ros2 topic pub /joint_trajectory_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
  stamp:
    sec: 0
    nanosec: 0
  frame_id: ''
joint_names: ['joint_1','joint_2','joint_4']
points: [ {"positions":[-1.57,-0.59,-1.2]} ]"

feel free to drop a comment in case it is not working.

Thanks, Ranjit

Hello there,

Thanks @gurselturkeri, for updating the launch file in the question, but I am sharing the details answer over here,

As @gurselturkeri suggested to installed joint_trajectory_controller, joint_state_broadcaster, controller_manager, joint-state-publisher-gui library.

I think you also need this below library to access gazebo controls. sudo apt-get install ros-humble-gazebo-ros2-control

About the Launch file, If you are using Ros2 Humble you need to correct

Node(
            package="controller_manager",
            executable="spawner",   
            arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
            ),
Node(
           package="controller_manager",
           executable="spawner",    
            arguments=["joint_trajectory_controller", "-c", "/controller_manager"],
            )

You can check every thing is working by executing the command into your terminal:

ros2 topic pub /joint_trajectory_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
  stamp:
    sec: 0
    nanosec: 0
  frame_id: ''
joint_names: ['joint_1','joint_2','joint_4']
points: [ {"positions":[-1.57,-0.59,-1.2]} ]"

feel free to drop a comment in case it is not working.

Thanks, Ranjit

working.

Hello there,

Thanks @gurselturkeri, for updating the launch file in the question, but I am sharing the details answer over here,

As @gurselturkeri suggested to installed joint_trajectory_controller, joint_state_broadcaster, controller_manager, joint-state-publisher-gui library.

I think you also need this below library to access gazebo controls. sudo apt-get install ros-humble-gazebo-ros2-control

About the Launch file, If you are using Ros2 Humble you need to correct

Check Which command is working in your case After installing controller-manager hit this commands in terminal ros2 run controller_manager spawner.py -h or ros2 run controller_manager spawner -h - This command is working in my case if it is so then change spawner.py to spawner in executable node.

Node(
            package="controller_manager",
            executable="spawner",   
            arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
            ),
Node(
           package="controller_manager",
           executable="spawner",    
            arguments=["joint_trajectory_controller", "-c", "/controller_manager"],
            )

You can check every thing is working by executing the command into your terminal:

ros2 topic pub /joint_trajectory_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
  stamp:
    sec: 0
    nanosec: 0
  frame_id: ''
joint_names: ['joint_1','joint_2','joint_4']
points: [ {"positions":[-1.57,-0.59,-1.2]} ]"

feel free to drop a comment in case it is not working.

Hello there,

Thanks @gurselturkeri, for updating the launch file in the question, but I am sharing the details answer over here,

As @gurselturkeri suggested to installed joint_trajectory_controller, joint_state_broadcaster, controller_manager, joint-state-publisher-gui library.

I think you also need this below library to access gazebo controls. sudo apt-get install ros-humble-gazebo-ros2-control

About the Launch file, If you are using Ros2 Humble you need to correct

Check Which command is working in your case After installing controller-manager hit this commands in terminal ros2 run controller_manager spawner.py -h spawner.py -h or ros2 run controller_manager spawner -h - This command is working in my case if it is so then change spawner.py to spawner in executable node.

Node(
            package="controller_manager",
            executable="spawner",   
            arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
            ),
Node(
           package="controller_manager",
           executable="spawner",    
            arguments=["joint_trajectory_controller", "-c", "/controller_manager"],
            )

You can check every thing is working by executing the command into your terminal:

ros2 topic pub /joint_trajectory_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
  stamp:
    sec: 0
    nanosec: 0
  frame_id: ''
joint_names: ['joint_1','joint_2','joint_4']
points: [ {"positions":[-1.57,-0.59,-1.2]} ]"

feel free to drop a comment in case it is not working.