Thanks a lot for your reply. And really sorry to reach back this late. But I tried following the tutorial and had several issues:
So I first created my collision model class as follows
from stretch_body.robot_collision import *
from stretch_body.hello_utils import *
YAW_MAX = 1.5
YAW_MIN = -0.4
PITCH_MAX = 0.2
PITCH_MIN = -0.5
#TODO: Add a readme explaining how to apply this CollisionModel to the robot
class CamStockCollisionModel(RobotCollisionModel):
def __init__(self, collision_manager):
RobotCollisionModel.__init__(self, collision_manager, 'CamStockCollisionModel')
def step(self, status):
return {'head_pan': [None, None],'head_tilt': [None, None],
'lift': [None, None],'arm': [None, None],
'wrist_yaw': [YAW_MIN, YAW_MAX], 'wrist_pitch': [PITCH_MIN, PITCH_MAX]}
In the tutorial it says to edit stretch_re1_user_params.yaml
and add the above class which I did but nothing happened. Note: Intially there was no such file present. Instead there was stretch_re1_user_params.migration_backup.20220923150601.yaml
. I renamed it to the required stretch_re1_user_params.yaml
.
So instead I added the Collision class to stretch_user_params.yaml
as below
#Parameters that are specific to this robot
#Do not edit, instead edit stretch_user_params.yaml
head:
baud: 115200
head_pan:
baud: 115200
head_tilt:
baud: 115200
hello-motor-lift:
gains:
i_safety_feedforward: 0.75
lift:
contact_models:
effort_pct: {}
i_feedforward: 0.75
params:
- stretch_tool_share.stretch_dex_wrist.params
robot:
tool: tool_stretch_dex_wrist
use_collision_manager: 1
stretch_gripper:
baud: 115200
range_t:
- 0
- 6415
zero_t: 4017
tool_none:
baud: 11520
tool_stretch_gripper:
baud: 115200
wrist_yaw:
baud: 115200
robot_collision:
models:
- CamStockCollisionModel
CamStockCollisionModel:
enabled: 1
py_class_name: 'CamStockCollisionModel'
py_module_name: 'CamStockCollisionModel'
After this, it did look like the collision class was being loaded, but still when I am controlling with the joystick, I can still do full default motions and it seems the safety limits in the my class I created didnt work.
I would really appreciate if you could help me figure out what am I doing wrong.
Thanks!