ADVRHumanoids/xbot2_examples

[XBot How To] Trivially Copiable Packet

Closed this issue · 1 comments

Hi,

I noticed that the fields of a packet must be trivially_copiable. This does not allow to use std containers like vectors, sets, maps, pairs and also std::string.

My aim (as an example) is to send a bunch of motor_name --- motor_pos_ref pairs with a packet, ideally a vector<pair<string,double>>.
Sees the "limitations" above, which is the standard idea of XBot2 to do this?

  • Instead of a string, device element (like motors) must be always identified as integer?
  • To send more than one pair, I have to send more than one packet?

Same behavior that I was looking for can be had using a client-server managers that exchange vectors of packet