Best Practice for Hall Endstop in ROS2 Control

Hello there

I currently am developing a robot arm using Odrives, with some transmissions in place to increase end effector torque. This means Ratios somewhere between 60:1 and 100:1 of motor rotation to end effector rotation.

I’ll need to add some endstops, so ROS2 control knows where the arm is in space.

Is it possible to hook the ODrive up to a couple of hall effect sensors, and have the data pass through that they are active or not via canbus, so I can tell ROS2 the position of the endstop.

I’d clearly prefer to use absolute value encoders, but those wont work in the case of using cycloidal gears.

It seems that I’d need to edit the ROS2 Hardware Interface a little bit in order to pass through this data. Does anyone have good insight of a simple change that would need to be made?

I currently have 6 Odrives up and running, each controlling an M8325 motor via CAN, connected to ROS2. They are able to give feedback that shows position in RVIZ (which models robot arm positions).

Thanks for looking

-Chris

Reading into this a little more, what I don’t see in the Canbus message system is anything reflecting what the GPIO pins are doing. So, to pass through GPIO messages, we’d need to edit the firmware to add an extra couple of messages?

Then the hardware interface would need to be edited to receive those messages.

Hi! Using CAN arbitrary parameter access, you can read get_gpio_states() just like you could in ODrivetool.

However, a better method may be to wire the hall sensors as an endstop, and then have the ODrives enter homing mode – you can configure them to zero their position (or set to a specified value) once they encounter the endstop.