File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/* *
2- A slightly upgraded version of packet 2 with two additions:
3- - Packet version, so that from now on the patient side can also distingish what is being received.
4- - Data of any number of additional key states added to the configuration.json.
2+ This is the information obtained from the haptic interface.
53*/
6- void UDPSender::send_packet_version_3 ()
4+ void send_manipulator_information_packet_version_3 ()
75{
86 QByteArray buffer;
97 QDataStream s (&buffer, QIODevice::WriteOnly);
@@ -73,3 +71,33 @@ void UDPSender::send_packet_version_3()
7371 }
7472 }
7573}
74+
75+
76+ /* *
77+ This is the "force" feedback information sent to the haptic interface.
78+ */
79+ void send_manipulator_force_information_packet_version_3 ()
80+ {
81+ QByteArray buffer_out;
82+ QDataStream s (&buffer_out,QIODevice::WriteOnly);
83+ s << packet_version;
84+ s << computer_index;
85+ s << number_of_manipulators;
86+
87+ for (auto i=0 ;i<number_of_manipulators;i++)
88+ {
89+ s << quint16 (1 );// Manipulator valid
90+ s << float (force_x) <<
91+ float (force_y) <<
92+ float (force_z) <<
93+ float (torque_x) <<
94+ float (torque_y) <<
95+ float (torque_z);
96+ }
97+
98+ quint16 crc16_out = qChecksum (buffer_out,buffer_out.size ());
99+ s << (quint16)crc16_out;
100+
101+ // Do something with the s
102+ }
103+
You can’t perform that action at this time.
0 commit comments