Christopheraburns / AWS-JPL-OSR-Challenge

Official repo of the AWS-JPL Open Source Rover challenge
Apache License 2.0
178 stars 112 forks source link

Model Resetting #16

Open crr0004 opened 4 years ago

crr0004 commented 4 years ago

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.

jordan-gleeson commented 4 years ago

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?

crr0004 commented 4 years ago

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 commented 4 years ago

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