Factor-Robotics / odrive_ros2_control

ODrive driver for ros2_control
Apache License 2.0
270 stars 83 forks source link

migrating from Foxy to galactic #11

Closed HusamZain closed 2 years ago

HusamZain commented 2 years ago

thank you for your contribution.

I'm using ros2 galactic, and trying to use your lib. but when I try to build the package, I got Screenshot from 2022-03-12 12-34-12 so I tried to migrate it to galactic as mentioned here in ros2-conttrol framework. this is the package after editing according to the ros2-control migration document, but I got this error Screenshot from 2022-03-13 18-37-24

I'm knew to programming and couldn't solve it, do you have any idea how to solve it?

borongyuan commented 2 years ago

Hi,

I see that there are some changes in the interface. Actually lifecycle node is indeed a better choice for managing hardware, which is a generic abstraction. I have tried it when implementing other drivers. Since it has not been introduced to the foxy branch of ros2_control, we won't update odrive_hardware_interface for this. We currently only intend to support LTS releases of ROS2. So we'll skip Galactic and look forward to Humble. If you have finished this part of migration, contributions are welcomed. For your current issue, it seems all the return_type should be replaced by CallbackReturn. From your screenshot, it looks like return_type is still being used somewhere in the code.

Thanks

HusamZain commented 2 years ago

@borongyuan thank you for your replay. yes and I changed all the return_type that was proposed in the documentation (configure, active ,deactive), but wasn't sure about the 'prepare_command_mode_switch', and if I do change it I got this error, sorry for the inconvenient Screenshot from 2022-03-14 09-19-05 any suggestion how could I solve it?

borongyuan commented 2 years ago

In this file both return_type and CallbackReturn are used. I just glanced at the code but don't know why. Anyway, this is the base class so we should have the same declaration.