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 @kak13,

I tried to run like this; ros2 topic pub --once /joint_states sensor_msgs/msg/JointState '{name, "front_right_wheel", position: [0.0], velocity: [1.0], effort: [0.0]}' --once

There are many mistakes in your command. 1. {name, "front_right_wheel" : Name is not properly defined. 2. --once : you are using this 2 times in your command. 3. string[] name = you have to pass in list formate, I think you are passing a single string.

ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{name: ["<your-name>], position: [0.0], velocity: [1.0], effort: [0.0]"}"

Hello @kak13,

I tried to run like this; ros2 topic pub --once /joint_states sensor_msgs/msg/JointState '{name, "front_right_wheel", position: [0.0], velocity: [1.0], effort: [0.0]}' --once

There are many mistakes in your command.

1.
  1. {name, "front_right_wheel" : Name is not properly defined. 2. defined.

  2. --once : you are using this 2 times in your command. 3. command.

  3. string[] name = you have to pass in list formate, I think you are passing a single string.

ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{name: ["<your-name>], position: [0.0], velocity: [1.0], effort: [0.0]"}"

Hello @kak13,

I tried to run like this; ros2 topic pub --once /joint_states sensor_msgs/msg/JointState '{name, "front_right_wheel", position: [0.0], velocity: [1.0], effort: [0.0]}' --once

There are many mistakes in your command.

  1. {name, "front_right_wheel" : Name is not properly defined.

  2. --once : you are using this 2 times in your command.

  3. string[] name = you have to pass in list formate, I think you are passing a single string.

ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{name: ["<your-name>], position: [0.0], velocity: [1.0], effort: [0.0]"}"

Try this if you are having any issues feel free to drop commet.

Hello @kak13,

I tried to run like this; ros2 topic pub --once /joint_states sensor_msgs/msg/JointState '{name, "front_right_wheel", position: [0.0], velocity: [1.0], effort: [0.0]}' --once

There are many mistakes in your command.

  1. {name, "front_right_wheel" : Name is not properly defined.

  2. --once : you are using this 2 times in your command.

  3. string[] name = you have to pass in list formate, I think you are passing a single string.

ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{name: ["<your-name>], position: [0.0], velocity: [1.0], effort: [0.0]"}"

Try this if you are having any issues feel free to drop commet.commet. I think this should work.

Hello @kak13,

I tried to run like this; ros2 topic pub --once /joint_states sensor_msgs/msg/JointState '{name, "front_right_wheel", position: [0.0], velocity: [1.0], effort: [0.0]}' --once

There are many mistakes in your command.

  1. {name, "front_right_wheel" : Name is not properly defined.

  2. --once : you are using this 2 times in your command.

  3. string[] name = you have to pass in list formate, I think you are passing a single string.

    ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{name: ["<your-name>], position: [0.0], velocity: [1.0], effort: [0.0]"}"

Try this if you are having any issues feel free to drop commet. I think this should work.

Hello @kak13,

I tried to run like this; ros2 topic pub --once /joint_states sensor_msgs/msg/JointState '{name, "front_right_wheel", position: [0.0], velocity: [1.0], effort: [0.0]}' --once

There are many mistakes in your command.

  1. {name, "front_right_wheel" : Name is not properly defined.

  2. --once : you are using this 2 times in your command.

  3. string[] name = you have to pass in list formate, I think you are passing a single string.

    ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{name: ["<your-name>], ["<your-name>"], position: [0.0], velocity: [1.0], effort: [0.0]"}"

Try this if you are having any issues feel free to drop commet. I think this should work.

Hello @kak13,

I tried to run like this; ros2 topic pub --once /joint_states sensor_msgs/msg/JointState '{name, "front_right_wheel", position: [0.0], velocity: [1.0], effort: [0.0]}' --once

There are many mistakes in your command.

  1. {name, "front_right_wheel" : Name is not properly defined.

  2. --once : you are using this 2 times in your command.

  3. string[] name = you have to pass in list formate, I think you are passing a single string.

    ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{name: ["<your-name>"], ['<your-name>'], position: [0.0], velocity: [1.0], effort: [0.0]"}"[0.0]}"

Try this if you are having any issues feel free to drop commet. I think this should work.

Hello @kak13,

I tried to run like this; ros2 topic pub --once /joint_states sensor_msgs/msg/JointState '{name, "front_right_wheel", position: [0.0], velocity: [1.0], effort: [0.0]}' --once

There are many mistakes in your command.

  1. {name, "front_right_wheel" : Name is not properly defined.

  2. --once : you are using this 2 times in your command.

  3. string[] name = you have to pass in list formate, I think you are passing a single string.

    ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist /joint_states sensor_msgs/msg/JointState "{name: ['<your-name>'], position: [0.0], velocity: [1.0], effort: [0.0]}"

And If you want to take multiple data in your Array then

ros2 topic pub --once /joint_states sensor_msgs/msg/JointState "{name: ['<your-name>', '<your-second-name>'], position: [0.0, 0.4], velocity: [1.0, 1.2], effort: [0.0, 0.4]}"

Try this if you are having any issues feel free to drop commet. I think this should work.