Hi,
So I have a question regarding teleoperating Reachy 2 from the Unity application, I’m trying to implement a safety behavior on the robot so the two arms cannot hit each other. When the arms get close, the robot should slow the motion, then hold the last safe joint command if the next command would bring the arms closer. A command that moves the arms apart should still be sent. The check needs the elbows and forearms, using both the commanded hand targets and the current joint states.
Unity hand pose
→ WebRTC / gRPC
→ reachy_abstract_bridge_node
→ /l_arm/ik_target_pose and /r_arm/ik_target_pose
(pollen_msgs/msg/IKRequest)
→ /kinematics, on_ik_target_pose
→ /l_arm_forward_position_controller/commands
and /r_arm_forward_position_controller/commands
(std_msgs/msg/Float64MultiArray)
So here are my understanding so far, the ROS is being run from inside a docker container and inside the core container, image ROS 2 Humble. WebRTC is pollenrobotics/webrtc:2.0.1.2_deploy. The running kinematics process loads:
/home/reachy/reachy_ws/build/pollen_kdl_kinematics/pollen_kdl_kinematics/pollen_kdl_kinematics_node.py
In on_ik_target_pose, the joint command is published with forward_publisher.publish(msg) after inverse kinematics. /joint_states is already subscribed in that node. /{arm}/cart_target_pose is published, but on our robot the kinematics node does not subscribe to it.
I would like to keep the streaming forward-position controllers. I do not want to switch the arms to trajectory controllers or MoveIt, because that would replace the controller Unity is using and would just add more complexity and miss to deal with.
Could you confirm this path for core and tell me the supported place to add this safety check?
-
Is the right place inside
on_ik_target_pose, after inverse kinematics and before the forward-position command is published? -
Is there a supported way to do this with a separate ROS node, without two publishers fighting over
/{arm}_forward_position_controller/commands? -
What is the supported way to keep a small change like this across a restart of the
corecontainer? -
Can the existing arm reachability message be used to tell the Unity client that a command was held?