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

How to force set robot arm joint values?

asked 2020-05-15 06:03:22 -0500

Rufus gravatar image

updated 2020-05-15 06:05:26 -0500

In order to test my motion planning, I wish to test from various starting positions in gazebo. In order to do that, I need to be able to programmatically set the joint values. How can this be done?

The closest thing I found is the service /gazebo/set_link_state but that requires manually specifying the transform of each individual link which seems unintuitive. Is there a better way?

edit retag flag offensive close merge delete

Comments

See whether the approach taken in #q352226 works for you.

This won't work if you really depend on the state of the Gazebo simulation though. Or at least it may not work as well.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-15 06:29:10 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-09-02 22:46:48 -0500

Rufus gravatar image

For some reason, /gazebo/set_model_configuration (as mentioned in this answer didn't work.)

However, I did discover the that gazebo_ros spawn_model supports specifying initial joint position. However, it must be done while physics is paused.

Here's the required snippets of the launch file

<include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" default="worlds/empty.world"/>
    <arg name="paused" value="true"/>
    <arg name="gui" value="$(arg gui)"/>
</include>

<node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -unpause -param robot_description -model robot -z 0.0 -J elbow_joint -1.57" respawn="false" output="screen" />
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-05-15 06:03:22 -0500

Seen: 715 times

Last updated: Sep 02 '20