ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
1

Initial joint angles

asked 2015-08-24 11:14:53 -0500

Sammac gravatar image

updated 2015-08-28 11:04:49 -0500

Hi,

Is there anyway to set the initial joint angles of the robot ? After reading a lot of pages and some packages of several robots, I have seen that it can be done by adding some args to the spawning node. However, I haven't been able to make it work for me. Right now, what I am doing is:

<node name="arm_base_spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model schunk_lwa4p_and_base 
    -J schunk_lwa4p_and_base::J_foldingSupport 0.075 
    -J schunk_lwa4p_and_base::J1_PowerBall -1.5607 
    -J schunk_lwa4p_and_base::J2_PowerBall -0.3817"
    respawn="false" output="screen" />

The robot is a lwa4p mounted over a mobile platform. For doing that, I am using xacros, being the robot schunk_lwa4p_and_base the union of all the xacros.

I would really appreciate if you can help me. Thank you in advance,

JLuis Samper

edit retag flag offensive close merge delete

Comments

Do you need that from config file? Or would just setting defaults in the URDF be sufficient?

dornhege gravatar imagedornhege ( 2015-08-24 11:57:43 -0500 )edit

Setting defaults is sufficient

Sammac gravatar imageSammac ( 2015-08-24 13:05:57 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-02-08 17:53:27 -0500

bsaund gravatar image

Start gazebo paused, then have spawn_model unpause gazebo.

<include file="(find gazebo_ros)/launch/empty_world.launch">
   ...
   <arg name="paused" value="true">
</include>

<node name="arm_base_spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model schunk_lwa4p_and_base 
    -J schunk_lwa4p_and_base::J_foldingSupport 0.075 
    ...
    -unpause 
    ..."/>

If this does not work, you can make your own version of "spawn_model", where you can pause gazebo, set the configuration, reset your joint controller, then unpause gazebo.

Some links I found helpful:

https://github.com/ros-simulation/gaz... https://github.com/ros-simulation/gaz...

edit flag offensive delete link more

Comments

This odd little workaround works for me. Thank you, bsaund :) Can anyone explain what's going on here in detail? I assume the controllers are somehow seeing different initial joint states if Gazebo is paused during initialization. Is there any plan to implement a more elegant solution? I might be able to make this contribution if I can better understand the problem.

mogumbo gravatar imagemogumbo ( 2019-03-21 19:54:05 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-08-24 11:14:53 -0500

Seen: 496 times

Last updated: Aug 28 '15