How to use RobotHardware in ros2?

asked 2022-10-17 03:47:57 -0500

Edvard gravatar image

Hi. Sorry for all mistakes, English is not my native language. This question is related to one I asked earlier, so I appreciate if you will read to the end, because It may confuse a little in the begging. So I have a code on Noetic that looks like this


hardware_interface::JointStateInterface js_interface_;
hardware_interface::EffortJointInterface ej_interface_;
hardware_interface::PositionJointInterface pj_interface_;
hardware_interface::VelocityJointInterface vj_interface_;

This is how they used in my code


js_interface_.registerHandle(BaseRobotHW::JointStateHandle(
    joint_names_[j], &joint_position_[j], &joint_velocity_[j], &joint_effort_[j]));    
ej_interface_.registerHandle(joint_handle);
pj_interface_.registerHandle(joint_handle);
vj_interface_.registerHandle(joint_handle);

...

registerInterface(&js_interface_);
registerInterface(&ej_interface_);
registerInterface(&pj_interface_);
registerInterface(&vj_interface_);

Thanks to the help with the previous question i know, that all four this interfaces has been replaced with RobotHardware. But I couldn't find, how to use this RobotHardware. There are no examples of use in demo hardware or, at least, a couldn't find any. I appreciate any help.

edit retag flag offensive close merge delete