tormach / hal_ros_control

A real-time ros_control implementation with Machinekit HAL and boilerplate
Other
47 stars 23 forks source link

2022 01 02 python port #9

Closed zultron closed 2 years ago

zultron commented 2 years ago

This PR is based on & follows #8, and is third in a series of four to the first version working under ROS2.

PR #8 fixes the C++ code, while this PR updates the Python launch scripts and hal_hw_interface module to the ROS2 launch and rclpy APIs, respectively. With this PR, the hal_hw_interface now works under ROS2; the next PR ports the hal_rrbot_control package to ROS2, providing a complete, running demo.

The Python port itself is fairly straightforward. Both the hal_hw_interface module and its tests ported more or less directly over, and rclpy mocking fixtures are added. The old HAL component mocking fixture was difficult to understand and irritating to use, and is now much improved.

This PR contains the fix for running the hal_control_node with Fast DDS discovery in UDP mode, needed for normal nodes to talk to the setuid executable where the RT environment and controller manager node runs.

Ament installs package libraries, including plugins & HAL components, in its own standard location. HAL components are by default installed in a different standard location. Using the ament location is more convenient for this project, and HAL can load components from an absolute path, so at build time, CMake generates a ROS2 parameter config file from template with the module's install location, and at run time, hal_mgr uses the parameter to locate the HAL component.

This PR also reenables the pep257 and lint_cmake tests in CI.

zultron commented 2 years ago

Rebased on #8, checks passing, ready for review! Thanks!