Open rickstaa opened 2 years ago
I've recently observed an issue stemming from the changes introduced in commit 89d25713b741631ca9f4f417585e7835d160cf4a. Specifically, after invoking the original Gazebo set_model_configuration
, the robot reverts to its initial position (see gif below). I adapted #226 to allow users to set the Franka configuration still.
roslaunch franka_gazebo panda.launch
)./gazebo/set_model_configuration
call:rosservice call /gazebo/set_model_configuration "model_name: 'panda'
urdf_param_name: 'robot_description'
joint_names:
- 'panda_joint2'
- 'panda_joint3'
joint_positions:
- 0
- 0.5"
During my RL training, the robot sometimes becomes stuck. When this happens, I use the /gazebo/set_model_configuration service to set the Panda robot to a free robot position. However, when doing this, the joint positions are sometimes reported to be outside their joint limits. This prevents third-party tools like MoveIt from functioning.
Why this happens is very clear by looking at the code:
https://github.com/frankaemika/franka_ros/blob/15f597566fd9f1aa1a66bce4c1b3b183e8aaa081/franka_gazebo/src/joint.cpp#L30
Every time the /gazebo/set_model_configuration changes the joint positions, they get added to the
joint->positions
attribute. As a result, when the change made by the /gazebo/set_model_configuration is too big, the reported joint positions are pushed outside the joint limits.I understand why this is implemented, but providing users with a way to reset the joint positions would be very helpful since it is a common use case.
I implemented a PR to add a
set_franka_model_configuration
service in #226.See the behaviour in action
roslaunch franka_gazebo panda.launch use_gripper:=false physics:=dart controller:='force_example_controller'
.franka_gazebo/scripts/log_joint_violations.py
script (i.e.rosrun franka_gazebo log_joint_violations.py
).franka_gazebo/scripts/set_random_joint_positions.py
script (i.e.rosrun franka_gazebo set_random_joint_positions.py
) script.See the fix in action
franka_gazebo/scripts/set_random_joint_positions_226.py
script (i.e.rosrun franka_gazebo set_random_joint_positions_226.py
).TODOs