AWS-JPL-OSR-Challenge icon indicating copy to clipboard operation
AWS-JPL-OSR-Challenge copied to clipboard

Model Resetting

Open crr0004 opened this issue 5 years ago • 3 comments

After setting up the repo locally and having everything running, I noticed the robot joints would disconnect and go all over the place. After much investigation I figured out it was the reset function. I think it would be more prudent to use the model reset function in gazebo. It's exposed as a service you can invoke this with something like

from std_srvs.srv import Empty
self.reset_models = rospy.ServiceProxy('/gazebo/reset_world', Empty)


#self.gazebo_model_state_service(model_state)
#self.gazebo_model_configuration_service(model_name='rover', urdf_param_name='rover_description', joint_names=joint_names_list, joint_positions=joint_positions_list)
self.reset_models()

Using that method just causes the model to return to the state it was in from the URDF/XML/launch files.

crr0004 avatar Feb 07 '20 04:02 crr0004

The reset_world only reset's the models pose (position and orientation) and won't influence the joints of the robot. Have you verified that it's the model state service that's causing the joints to fall apart? On my hardware, and some others, this issue is not occurring. What if you add in reset_world as well as retaining the model state configuration service?

jordan-gleeson avatar Feb 07 '20 05:02 jordan-gleeson

I restored the joint reset and it is working as expected now, I have left the model_state restoration commented out.

Yeah I verified it was the model_state service causing the issue by process of elimination. I think a couple other people are experiencing the issue on the slack channel. The only possible thing I can think of is that the values on the model_state are slightly off. I will try having both in there

crr0004 avatar Feb 08 '20 01:02 crr0004

Seems to work just as well doing the reset_models and then the others ¯\_(ツ)_/¯

crr0004 avatar Feb 08 '20 01:02 crr0004