kindredresearch / SenseAct

SenseAct: A computational framework for developing real-world robot learning tasks
https://www.kindred.ai/SenseAct
BSD 3-Clause "New" or "Revised" License
214 stars 42 forks source link

The reacher environment on UR5 can now be used with higher speeds and accelerations without incurring protective stops. #69

Closed homayoonfarrahi closed 1 year ago

homayoonfarrahi commented 1 year ago

The UR5 robot expects actuation commands every 8ms. This was violated in the original environment and communicator, causing protective stops. It was fixed by using the stopj command in a few places. In addition, the original environment would change the acceleration value permanently if the robot went out of bounds. It is now reset to the initial value for every actuation. These improvements were imported from https://github.com/homayoonfarrahi/cycle-time-study/tree/master/senseact_mod.

csherstan commented 1 year ago

Can you explain how this improves behavior? It's not obvious to me that using the stopj command would result in higher speeds and accelerations without triggering protective stops.

homayoonfarrahi commented 1 year ago

By trial and error, I found three scenarios where protective stops were happening in velocity control mode. The first scenario was when a fast-moving UR5 was suddenly deprived of 125Hz speedj commands. This could happen, for instance, if the learner process crashed or the learner's update took longer than 0.5s while the update and env.step(act) were executing synchronously. Or if there was too much delay between the episode's end and the subsequent reset.

The second scenario was sending movej commands to a fast-moving arm without stopping it first. The third scenario was sending nan commands resulting from division-by-zeros. The first two scenarios are fixed by stopping the arm first using the stopj command.

The speed acceleration value was also changed permanently if UR5 went out of bounds. It is now reset to the original value for every actuation.

csherstan commented 1 year ago

Ok, sounds good. Please merge.

homayoonfarrahi commented 1 year ago

Can you give me write access please? I can't merge without it.

csherstan commented 1 year ago

Can you give me write access please? I can't merge without it.

Actually, I don't have authority to do that, but I can merge it in myself. However, I had a couple of comments I left in review. Please let me know if you're willing to address them or not. They won't block the merge.

homayoonfarrahi commented 1 year ago

Ok, I will address these, do a test run, and let you know.

homayoonfarrahi commented 1 year ago

I addressed the comments @csherstan. The test run was good. Please proceed with the merge.