ADVRHumanoids / xbot2_examples

Examples and tutorials on the new XBot2 framework -- WIP
9 stars 4 forks source link

[XBot How To] Using different message packets for a driver #15

Closed torydebra closed 3 years ago

torydebra commented 4 years ago

If I understood well, a driver can communicate on one side with a client using a Packet1 type, and on the other side with the robot using a Packet2 type. How can I perform this?

See the code class DeviceDriverTpl : public DeviceTplCommon<rx_type, tx_type> here we have only "one side" communication.

Theoretically I should need something like: class DeviceDriverTpl : public DeviceTplCommon<rx_type_side1, tx_type_side1, rx_type_side2, tx_type_side2>

Am I wrong?

alaurenzi commented 4 years ago

The template determines the internal _rx and _tx structures, as well as the internal messages being sent inside the framework. Your role as implementer of DeviceDriverTpl::sense_impl and DeviceDriverTpl::move_impl is to fill/read those structs from any representation available to you when speaking with the actual device.

torydebra commented 3 years ago

Closing because that was not how xbot2 worked, it was my misunderstanding