You're reading the documentation for a development version. For the latest released version, please have a look at Iron.
Foxy to Galactic
hardware_interface
Between Foxy and Galactic we made substantial changes to the interface of hardware components to enable management of their lifecycle. The following list shows a set of quick changes to port existing hardware components to Galactic:
Rename
configure
toon_init
and change return type toCallbackReturn
If using BaseInterface as base class then you should remove it. Specifically, change:
hardware_interface::BaseInterface<hardware_interface::[Actuator|Sensor|System]Interface>to
hardware_interface::[Actuator|Sensor|System]Interface
Remove include of headers
base_interface.hpp
andhardware_interface_status_values.hpp
Add include of header
rclcpp_lifecycle/state.hpp
although this may not be strictly necessaryreplace first three lines in
on_init
to
if (hardware_interface::[Actuator|Sensor|System]Interface::on_init(info) != CallbackReturn::SUCCESS) { return CallbackReturn::ERROR; }
Change last return of
on_init
toreturn CallbackReturn::SUCCESS;
Remove all lines with
status_ = ...
orstatus::...
Rename
start()
toon_activate(const rclcpp_lifecycle::State & previous_state)
andstop()
toon_deactivate(const rclcpp_lifecycle::State & previous_state)
Change return type of
on_activate
andon_deactivate
toCallbackReturn
Change last return of
on_activate
andon_deactivate
toreturn CallbackReturn::SUCCESS;
If you have any
return_type::ERROR
inon_init
,on_activate
, orin_deactivate
change toCallbackReturn::ERROR
If you get link errors with undefined refernences to symbols in
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface
, then addrclcpp_lifecyle
package dependency toCMakeLists.txt
andpackage.xml