From ba926a780cb500a4d66f690df4b2fe7078e91246 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Fri, 14 Mar 2025 16:51:57 +0100 Subject: [PATCH] pose sync is working --- DoxyGen/DoxyWarnLogfile.txt | 186 ++++++++++++++++++++---------------- Examples/BB2B_networking.py | 11 ++- LinearAlgebra/SwingTwist.py | 6 ++ LocalParticipant.py | 59 ++++++++---- Messages/BinaryMsg.py | 62 ++++++++---- Messages/Messages.py | 2 +- Messages/PoseMsg.py | 28 +++--- README.md | 6 +- SiteServer.py | 2 +- Thing.py | 31 +++++- 10 files changed, 242 insertions(+), 151 deletions(-) diff --git a/DoxyGen/DoxyWarnLogfile.txt b/DoxyGen/DoxyWarnLogfile.txt index cd6bceb..b194046 100644 --- a/DoxyGen/DoxyWarnLogfile.txt +++ b/DoxyGen/DoxyWarnLogfile.txt @@ -1,87 +1,105 @@ warning: source 'images' is not a readable file or directory... skipping. -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:57: warning: @copybrief or @copydoc target 'Thing::Update' not found -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:46: warning: Found unknown command '@params' -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:22: warning: Member SetDriveDimensions(self, wheel_diameter, wheel_separation) (function) of class DifferentialDrive.DifferentialDrive is not documented. -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:33: warning: Member SetMotors(self, wheel_left, wheel_right) (function) of class DifferentialDrive.DifferentialDrive is not documented. -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:46: warning: Found unknown command '@params' -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:57: warning: @copybrief or @copydoc target 'Thing::Update' not found -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:19: warning: Member wheel_left (variable) of class DifferentialDrive.DifferentialDrive is not documented. -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:20: warning: Member wheel_right (variable) of class DifferentialDrive.DifferentialDrive is not documented. -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:46: warning: Found unknown command '@params' -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:47: warning: Found unknown command '@params' -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:57: warning: @copybrief or @copydoc target 'Thing::Update' not found -d:/Python/RoboidControl-python/Things/DifferentialDrive.py:58: warning: @copydetails or @copydoc target 'Thing::Update' not found -d:/Python/RoboidControl-python/LocalParticipant.py:61: warning: Member GetParticipant(self, ip_address, port) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:71: warning: Member AddParticipant(self, ip_address, port) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:93: warning: Member SendThingInfo(self, thing) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:98: warning: Member Send(self, msg) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:107: warning: Member Publish(self, msg) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:120: warning: Member Receiver(self) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:132: warning: Member ReceiveData(self, data, remote_participant) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:152: warning: Member ProcessClientMsg(self, sender, ParticipantMsg msg) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:155: warning: Member ProcessNetworkIdMsg(self, sender, NetworkIdMsg msg) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:164: warning: Member ProcessInvestigateMsg(self, bytearray data) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:167: warning: Member ProcessThingMsg(self, ThingMsg msg) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:179: warning: Member ProcessNameMsg(self, NameMsg msg) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:182: warning: Member ProcessModelUrlMsg(self, ModelUrlMsg msg) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:185: warning: Member ProcessBinary(self, BinaryMsg msg) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:191: warning: Member Register(self, constructor, thing_type) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:194: warning: Member OnNewThing(self, event_handler) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:197: warning: Member OnNewThingType(self, thing_type, event_handler) (function) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:39: warning: Member ip_address (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:40: warning: Member port (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:44: warning: Member thing_msg_processors (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:45: warning: Member new_thing_handlers (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:48: warning: Member udp_socket (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:85: warning: Member nextPublishMe (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:27: warning: Member publishInterval (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:29: warning: Member buffer (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:32: warning: Member nextPublishMe (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:33: warning: Member others (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:34: warning: Member thread (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/LocalParticipant.py:35: warning: Member name (variable) of class RoboidControl-python.LocalParticipant.LocalParticipant is not documented. -d:/Python/RoboidControl-python/Messages/Messages.py:115: warning: Member __init__(self, network_id, thing) (function) of class RoboidControl-python.Messages.Messages.PoseMsg is not documented. -d:/Python/RoboidControl-python/Messages/Messages.py:119: warning: Member Serialize(self, buffer_ref) (function) of class RoboidControl-python.Messages.Messages.PoseMsg is not documented. -d:/Python/RoboidControl-python/Messages/Messages.py:116: warning: Member network_id (variable) of class RoboidControl-python.Messages.Messages.PoseMsg is not documented. -d:/Python/RoboidControl-python/Messages/Messages.py:117: warning: Member thing (variable) of class RoboidControl-python.Messages.Messages.PoseMsg is not documented. -d:/Python/RoboidControl-python/Messages/NetworkIdMsg.py:7: warning: Member id (variable) of class RoboidControl-python.Messages.NetworkIdMsg.NetworkIdMsg is not documented. -d:/Python/RoboidControl-python/Messages/NetworkIdMsg.py:8: warning: Member length (variable) of class RoboidControl-python.Messages.NetworkIdMsg.NetworkIdMsg is not documented. -d:/Python/RoboidControl-python/Messages/NetworkIdMsg.py:10: warning: Member network_id (variable) of class RoboidControl-python.Messages.NetworkIdMsg.NetworkIdMsg is not documented. -d:/Python/RoboidControl-python/Messages/ParticipantMsg.py:53: warning: Member SendTo(participant, network_id) (function) of class RoboidControl-python.Messages.ParticipantMsg.ParticipantMsg is not documented. -d:/Python/RoboidControl-python/Messages/ParticipantMsg.py:64: warning: Member Publish(participant, network_id) (function) of class RoboidControl-python.Messages.ParticipantMsg.ParticipantMsg is not documented. -d:/Python/RoboidControl-python/Messages/ParticipantMsg.py:41: warning: Member Serialized(buffer_ref, network_id) (function) of class RoboidControl-python.Messages.ParticipantMsg.ParticipantMsg is not documented. -d:/Python/RoboidControl-python/Messages/ParticipantMsg.py:21: warning: Member network_id (variable) of class RoboidControl-python.Messages.ParticipantMsg.ParticipantMsg is not documented. -d:/Python/RoboidControl-python/SiteServer.py:42: warning: Member AddParticipant(self, ip_address, port) (function) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:49: warning: Member ProcessClientMsg(self, sender, msg) (function) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:56: warning: Member ProcessNetworkId(self, msg) (function) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:60: warning: Member Register(self, ThingClass, thing_type) (function) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:63: warning: Member Process(self, msg) (function) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:69: warning: Member ProcessThingMsg(self, msg) (function) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:20: warning: Member ip_address (variable) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:21: warning: Member port (variable) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:22: warning: Member publishInterval (variable) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:23: warning: Member others (variable) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:24: warning: Member network_id (variable) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:25: warning: Member buffer (variable) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:26: warning: Member thing_msg_constructors (variable) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:29: warning: Member udp_socket (variable) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:34: warning: Member thread (variable) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:14: warning: Member name (variable) of class RoboidControl-python.SiteServer.SiteServer is not documented. -d:/Python/RoboidControl-python/SiteServer.py:18: warning: The following parameters of RoboidControl-python.SiteServer.SiteServer.__init__(self, port=7681, remote=False, udp_socket=None) are not documented: +d:/Python/RoboidControl/Things/DifferentialDrive.py:62: warning: @copybrief or @copydoc target 'Thing::Update' not found +d:/Python/RoboidControl/Things/DifferentialDrive.py:46: warning: Found unknown command '@params' +d:/Python/RoboidControl/Things/DifferentialDrive.py:22: warning: Member SetDriveDimensions(self, wheel_diameter, wheel_separation) (function) of class DifferentialDrive.DifferentialDrive is not documented. +d:/Python/RoboidControl/Things/DifferentialDrive.py:33: warning: Member SetMotors(self, wheel_left, wheel_right) (function) of class DifferentialDrive.DifferentialDrive is not documented. +d:/Python/RoboidControl/Things/DifferentialDrive.py:46: warning: Found unknown command '@params' +d:/Python/RoboidControl/Things/DifferentialDrive.py:62: warning: @copybrief or @copydoc target 'Thing::Update' not found +d:/Python/RoboidControl/Things/DifferentialDrive.py:31: warning: Member wheel_left (variable) of class DifferentialDrive.DifferentialDrive is not documented. +d:/Python/RoboidControl/Things/DifferentialDrive.py:31: warning: Member wheel_right (variable) of class DifferentialDrive.DifferentialDrive is not documented. +d:/Python/RoboidControl/Things/DifferentialDrive.py:46: warning: Found unknown command '@params' +d:/Python/RoboidControl/Things/DifferentialDrive.py:47: warning: Found unknown command '@params' +d:/Python/RoboidControl/Things/DifferentialDrive.py:62: warning: @copybrief or @copydoc target 'Thing::Update' not found +d:/Python/RoboidControl/Things/DifferentialDrive.py:63: warning: @copydetails or @copydoc target 'Thing::Update' not found +d:/Python/RoboidControl/LocalParticipant.py:76: warning: Member GetParticipant(self, ip_address, port) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:86: warning: Member AddParticipant(self, ip_address, port) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:119: warning: Member SendThingInfo(self, owner, thing, bool recursively=False) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:129: warning: Member Send(self, owner, msg) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:138: warning: Member Publish(self, msg) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:151: warning: Member Receiver(self) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:163: warning: Member ReceiveData(self, data, sender) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:183: warning: Member ProcessClientMsg(self, sender, ParticipantMsg msg) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:186: warning: Member ProcessNetworkIdMsg(self, sender, NetworkIdMsg msg) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:196: warning: Member ProcessInvestigateMsg(self, bytearray data) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:199: warning: Member ProcessThingMsg(self, ThingMsg msg) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:211: warning: Member ProcessNameMsg(self, NameMsg msg) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:214: warning: Member ProcessModelUrlMsg(self, ModelUrlMsg msg) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:217: warning: Member ProcessBinary(self, BinaryMsg msg) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:223: warning: Member Register(self, constructor, thing_type) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:226: warning: Member OnNewThing(self, event_handler) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:229: warning: Member OnNewThingType(self, thing_type, event_handler) (function) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:42: warning: Member local_port (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:58: warning: Member thing_msg_processors (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:59: warning: Member new_thing_handlers (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:60: warning: Member publishInterval (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:64: warning: Member udp_socket (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:105: warning: Member nextPublishMe (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:144: warning: Member port (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:29: warning: Member buffer (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:32: warning: Member nextPublishMe (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:33: warning: Member others (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:34: warning: Member thread (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/LocalParticipant.py:35: warning: Member name (variable) of class RoboidControl.LocalParticipant.LocalParticipant is not documented. +d:/Python/RoboidControl/Messages/Messages.py:115: warning: Member __init__(self, network_id, thing) (function) of class RoboidControl.Messages.Messages.PoseMsg is not documented. +d:/Python/RoboidControl/Messages/Messages.py:119: warning: Member Serialize(self, buffer_ref) (function) of class RoboidControl.Messages.Messages.PoseMsg is not documented. +d:/Python/RoboidControl/Messages/Messages.py:116: warning: Member network_id (variable) of class RoboidControl.Messages.Messages.PoseMsg is not documented. +d:/Python/RoboidControl/Messages/Messages.py:117: warning: Member thing (variable) of class RoboidControl.Messages.Messages.PoseMsg is not documented. +d:/Python/RoboidControl/Messages/NetworkIdMsg.py:7: warning: Member id (variable) of class RoboidControl.Messages.NetworkIdMsg.NetworkIdMsg is not documented. +d:/Python/RoboidControl/Messages/NetworkIdMsg.py:8: warning: Member length (variable) of class RoboidControl.Messages.NetworkIdMsg.NetworkIdMsg is not documented. +d:/Python/RoboidControl/Messages/NetworkIdMsg.py:10: warning: Member network_id (variable) of class RoboidControl.Messages.NetworkIdMsg.NetworkIdMsg is not documented. +d:/Python/RoboidControl/Messages/ParticipantMsg.py:53: warning: Member SendTo(participant, network_id) (function) of class RoboidControl.Messages.ParticipantMsg.ParticipantMsg is not documented. +d:/Python/RoboidControl/Messages/ParticipantMsg.py:64: warning: Member Publish(participant, network_id) (function) of class RoboidControl.Messages.ParticipantMsg.ParticipantMsg is not documented. +d:/Python/RoboidControl/Messages/ParticipantMsg.py:41: warning: Member Serialized(buffer_ref, network_id) (function) of class RoboidControl.Messages.ParticipantMsg.ParticipantMsg is not documented. +d:/Python/RoboidControl/Messages/ParticipantMsg.py:21: warning: Member network_id (variable) of class RoboidControl.Messages.ParticipantMsg.ParticipantMsg is not documented. +d:/Python/RoboidControl/SiteServer.py:42: warning: Member AddParticipant(self, ip_address, port) (function) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:49: warning: Member ProcessClientMsg(self, sender, msg) (function) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:56: warning: Member ProcessNetworkId(self, msg) (function) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:60: warning: Member Register(self, ThingClass, thing_type) (function) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:63: warning: Member Process(self, msg) (function) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:69: warning: Member ProcessThingMsg(self, msg) (function) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:20: warning: Member ip_address (variable) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:21: warning: Member port (variable) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:22: warning: Member publishInterval (variable) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:23: warning: Member others (variable) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:24: warning: Member network_id (variable) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:25: warning: Member buffer (variable) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:26: warning: Member thing_msg_constructors (variable) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:29: warning: Member udp_socket (variable) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:34: warning: Member thread (variable) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:14: warning: Member name (variable) of class RoboidControl.SiteServer.SiteServer is not documented. +d:/Python/RoboidControl/SiteServer.py:18: warning: The following parameters of RoboidControl.SiteServer.SiteServer.__init__(self, port=7681, remote=False, udp_socket=None) are not documented: parameter 'remote' parameter 'udp_socket' -d:/Python/RoboidControl-python/Thing.py:57: warning: Member update(self, currentTime) (function) of class RoboidControl-python.Thing.Thing is not documented. -d:/Python/RoboidControl-python/Thing.py:60: warning: Member ProcessBinary(self, data) (function) of class RoboidControl-python.Thing.Thing is not documented. -d:/Python/RoboidControl-python/Thing.py:38: warning: Member parent_id (variable) of class RoboidControl-python.Thing.Thing is not documented. -d:/Python/RoboidControl-python/Thing.py:54: warning: Member pose_updated (variable) of class RoboidControl-python.Thing.Thing is not documented. -d:/Python/RoboidControl-python/Thing.py:17: warning: Member Position (variable) of class RoboidControl-python.Thing.Thing is not documented. -d:/Python/RoboidControl-python/Thing.py:18: warning: Member Orientation (variable) of class RoboidControl-python.Thing.Thing is not documented. -d:/Python/RoboidControl-python/Thing.py:19: warning: Member LinearVelocity (variable) of class RoboidControl-python.Thing.Thing is not documented. -d:/Python/RoboidControl-python/Thing.py:20: warning: Member AngularVelocity (variable) of class RoboidControl-python.Thing.Thing is not documented. -d:/Python/RoboidControl-python/Thing.py:9: warning: Member Undetermined (variable) of class RoboidControl-python.Thing.Thing.Type is not documented. -d:/Python/RoboidControl-python/Thing.py:11: warning: Member Switch (variable) of class RoboidControl-python.Thing.Thing.Type is not documented. -d:/Python/RoboidControl-python/Thing.py:12: warning: Member DistanceSensor (variable) of class RoboidControl-python.Thing.Thing.Type is not documented. -d:/Python/RoboidControl-python/Thing.py:13: warning: Member DirectionalSensor (variable) of class RoboidControl-python.Thing.Thing.Type is not documented. -d:/Python/RoboidControl-python/Thing.py:14: warning: Member TemperatureSensor (variable) of class RoboidControl-python.Thing.Thing.Type is not documented. -d:/Python/RoboidControl-python/Thing.py:15: warning: Member Animator (variable) of class RoboidControl-python.Thing.Thing.Type is not documented. -d:/Python/RoboidControl-python/LinearAlgebra/SwingTwist.py:6: warning: Member __init__(self, Direction swing, float twist) (function) of class SwingTwist.SwingTwist is not documented. +d:/Python/RoboidControl/Thing.py:92: warning: Member Update(self, currentTime) (function) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:95: warning: Member ProcessBinary(self, data) (function) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:99: warning: Member SetParent(self, parent) (function) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:108: warning: Member AddChild(self, child) (function) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:115: warning: Member RemoveChild(self, child) (function) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:31: warning: Member children (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:61: warning: Member pose_updated (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:68: warning: Member position (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:69: warning: Member position_updated (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:75: warning: Member orientation (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:76: warning: Member orientation_updated (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:82: warning: Member linear_velocity (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:83: warning: Member linear_velocity_updated (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:89: warning: Member angular_velocity (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:90: warning: Member angular_velocity_updated (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:18: warning: Member Position (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:19: warning: Member Orientation (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:20: warning: Member LinearVelocity (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:21: warning: Member AngularVelocity (variable) of class RoboidControl.Thing.Thing is not documented. +d:/Python/RoboidControl/Thing.py:80: warning: argument 'linearVelocity' of command @param is not found in the argument list of Thing::SetLinearVelocity(self, linear_velocity) +d:/Python/RoboidControl/Thing.py:80: warning: The following parameter of RoboidControl.Thing.Thing.SetLinearVelocity(self, linear_velocity) is not documented: + parameter 'linear_velocity' +d:/Python/RoboidControl/Thing.py:87: warning: argument 'angularVelocity' of command @param is not found in the argument list of Thing::SetAngularVelocity(self, angular_velocity) +d:/Python/RoboidControl/Thing.py:87: warning: The following parameter of RoboidControl.Thing.Thing.SetAngularVelocity(self, angular_velocity) is not documented: + parameter 'angular_velocity' +d:/Python/RoboidControl/Thing.py:10: warning: Member Undetermined (variable) of class RoboidControl.Thing.Thing.Type is not documented. +d:/Python/RoboidControl/Thing.py:12: warning: Member Switch (variable) of class RoboidControl.Thing.Thing.Type is not documented. +d:/Python/RoboidControl/Thing.py:13: warning: Member DistanceSensor (variable) of class RoboidControl.Thing.Thing.Type is not documented. +d:/Python/RoboidControl/Thing.py:14: warning: Member DirectionalSensor (variable) of class RoboidControl.Thing.Thing.Type is not documented. +d:/Python/RoboidControl/Thing.py:15: warning: Member TemperatureSensor (variable) of class RoboidControl.Thing.Thing.Type is not documented. +d:/Python/RoboidControl/Thing.py:16: warning: Member Animator (variable) of class RoboidControl.Thing.Thing.Type is not documented. +d:/Python/RoboidControl/LinearAlgebra/SwingTwist.py:6: warning: Member __init__(self, Direction swing, float twist) (function) of class SwingTwist.SwingTwist is not documented. +d:/Python/RoboidControl/LinearAlgebra/SwingTwist.py:18: warning: Member Degrees(float horizontal, float vertical, float twist) (function) of class SwingTwist.SwingTwist is not documented. diff --git a/Examples/BB2B_networking.py b/Examples/BB2B_networking.py index e36fba5..138e579 100644 --- a/Examples/BB2B_networking.py +++ b/Examples/BB2B_networking.py @@ -1,20 +1,25 @@ import sys from os import path sys.path.append(path.abspath(path.join(path.dirname(__file__), '..'))) +import time from LocalParticipant import LocalParticipant +from Thing import * from Things.DifferentialDrive import DifferentialDrive from Things.TouchSensor import TouchSensor -import time # Create a local participant for handling communcation # using default settings (UDP communciation over port 7681) -participant = LocalParticipant(port=7681, local_port=7682) +participant = LocalParticipant(port=7681, local_port=7682, ip_address="127.0.0.1") # The robot's propulsion is a differential drive bb2b = DifferentialDrive(participant) bb2b.name = "BB2B" -bb2b.model_url = "https://passer.life/extras/ant1_transparent.png" bb2b.SetDriveDimensions(0.064, 0.128) +bb2b.SetPosition(Spherical(0.15, Direction.up)) + +model = Thing(parent=bb2b) +model.model_url = "https://passer.life/extras/Roller1anim1.png" +model.SetOrientation(SwingTwist.Degrees(90, 0, 0)) # It has a touch sensor at the front left of the roboid touch_left = TouchSensor(parent=bb2b) diff --git a/LinearAlgebra/SwingTwist.py b/LinearAlgebra/SwingTwist.py index 206616c..19a8992 100644 --- a/LinearAlgebra/SwingTwist.py +++ b/LinearAlgebra/SwingTwist.py @@ -14,6 +14,12 @@ class SwingTwist: ## The twist component of the rotation self.twist = twist + @staticmethod + def Degrees(horizontal: float, vertical: float, twist: float): + direction = Direction(horizontal, vertical) + swing_twist = SwingTwist(direction, twist) + return swing_twist + def ToQuaternion(self) -> Quaternion: """Convert the SwingTwist rotation to a Quaternion""" q = Quaternion.Euler(-self.swing.vertical, diff --git a/LocalParticipant.py b/LocalParticipant.py index 7a90c13..8d19cae 100644 --- a/LocalParticipant.py +++ b/LocalParticipant.py @@ -34,13 +34,24 @@ class LocalParticipant(Participant): thread = None name = "Participant" - def __init__(self, port=7681, ip_address="0.0.0.0", local_port=0, remote=False, udp_socket = None): - super().__init__(ip_address = ip_address, port = port) - # self.ip_address = ip_address - # self.port = port + def __init__(self, port=7681, ip_address="0.0.0.0", local_port=0): #, remote=False, udp_socket = None): + super().__init__(ip_address = "0.0.0.0", port = port) + if local_port == 0: local_port = port self.local_port = local_port + + ## True if the participant is running isolated. + # Isolated participants do not communicate with other participants + self.isolated = True + + ## The remote site when this participant is connected to a site + self.remote_site = None + + if self.port != 0: + self.isolated = False + self.remote_site = Participant(ip_address, port) + self.others = [] self.network_id = 0 self.buffer = bytearray(256) @@ -49,17 +60,16 @@ class LocalParticipant(Participant): self.publishInterval = 3000 # 3 seconds - if remote == False: - self.udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - self.udp_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) - self.udp_socket.bind(("0.0.0.0", self.local_port)) - #self.AddParticipant(self.ip_address, self.port) + #if remote == False: + self.udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + self.udp_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) + self.udp_socket.bind(("0.0.0.0", self.local_port)) - self.thread = threading.Thread(target = self.Receiver) - self.thread.daemon = True - self.thread.start() - else: - self.udp_socket = udp_socket + self.thread = threading.Thread(target = self.Receiver) + self.thread.daemon = True + self.thread.start() + # else: + # self.udp_socket = udp_socket #region Update @@ -85,15 +95,20 @@ class LocalParticipant(Participant): currentTimeMs = time.time() * 1000 if self.publishInterval > 0 and currentTimeMs > self.nextPublishMe: - self.Publish(ParticipantMsg(self.network_id)) - print(f'Publish ClientMsg {self.network_id}') + msg = ParticipantMsg(self.network_id) + if self.remote_site is None: + self.Publish(msg) + else: + self.Send(self.remote_site, msg) + + print(f'Publish ParticipantMsg {self.network_id}') self.nextPublishMe = currentTimeMs + self.publishInterval for thing in self.things: thing.Update(currentTimeMs) - pose_msg = PoseMsg(self.network_id, thing) - for other in self.others: - self.Send(other, pose_msg) + # pose_msg = PoseMsg(self.network_id, thing) + # for other in self.others: + # self.Send(other, pose_msg) super().Update(currentTimeMs) @@ -105,6 +120,8 @@ class LocalParticipant(Participant): self.Send(owner, ThingMsg(self.network_id, thing)) self.Send(owner, NameMsg(self.network_id, thing)) self.Send(owner, ModelUrlMsg(self.network_id, thing)) + self.Send(owner, PoseMsg(self.network_id, thing, True)) + # self.Send(owner, BinaryMsg(self.network_id, thing)) if recursively: for child in thing.children: @@ -150,7 +167,7 @@ class LocalParticipant(Participant): # print(f'msg {msgId} ') match msgId: case ParticipantMsg.id: - self.ProcessClientMsg(sender, ParticipantMsg(data)) + self.ProcessParticipantMsg(sender, ParticipantMsg(data)) case NetworkIdMsg.id: self.ProcessNetworkIdMsg(sender, NetworkIdMsg(data)) # case InvestigateMsg.id: @@ -165,7 +182,7 @@ class LocalParticipant(Participant): # msg = Messages.BinaryMsg(data) # msg.thing.ProcessBinary(msg.data) - def ProcessClientMsg(self, sender, msg: ParticipantMsg): + def ProcessParticipantMsg(self, sender, msg: ParticipantMsg): pass def ProcessNetworkIdMsg(self, sender, msg: NetworkIdMsg): diff --git a/Messages/BinaryMsg.py b/Messages/BinaryMsg.py index fba2786..be9a902 100644 --- a/Messages/BinaryMsg.py +++ b/Messages/BinaryMsg.py @@ -1,26 +1,48 @@ -from Thing import Thing +#from Thing import Thing class BinaryMsg(): id = 0xB1 + length = 3 - def __init__(self, buffer): - self.network_id = buffer[1] - self.thing_id = buffer[2] - self.thing: Thing = Thing.Get(self.network_id, self.thing_id) - self.data = buffer[3:] + def __init__(self, data, thing = None): + if isinstance(data, bytearray): + self.network_id = data[1] + self.thing_id = data[2] + #self.thing: Thing = Thing.Get(self.network_id, self.thing_id) + self.data = data[3:] + else: + self.network_id = data + self.thing_id = thing.id + self.thing = thing - def SendTo(participant, thing, data: bytearray): - length = 3 - - if thing.network_id is None or thing is None or data is None: - return False + def Serialize(self, buffer_ref): + if self.network_id is None or self.thing_id is None: + return 0 - participant.buffer[0:length] = [ - BinaryMsg.id, - participant.network_id, - thing.id - ] - full_length = length + len(data) - participant.buffer[length:full_length] = data - participant.SendBuffer(full_length) - return True \ No newline at end of file + buffer: bytearray = buffer_ref[0] + ix = self.length + self.thing.GenerateBinary(buffer, {ix}) + if ix <= self.length: + return 0 + + buffer[0] = self.id + buffer[1] = self.network_id + buffer[2] = self.thing_id + return ix + + + # def SendTo(participant, thing, data: bytearray): + # length = 3 + + # if thing.network_id is None or thing is None or data is None: + # return False + + # participant.buffer[0:length] = [ + # BinaryMsg.id, + # participant.network_id, + # thing.id + # ] + # full_length = length + len(data) + # participant.buffer[length:full_length] = data + # participant.SendBuffer(full_length) + # return True \ No newline at end of file diff --git a/Messages/Messages.py b/Messages/Messages.py index 941be44..23be391 100644 --- a/Messages/Messages.py +++ b/Messages/Messages.py @@ -1,5 +1,5 @@ import Messages.LowLevelMessages as LowLevelMessages -from Thing import Thing +#from Thing import Thing class IMessage: id = 0x00 diff --git a/Messages/PoseMsg.py b/Messages/PoseMsg.py index 95a13d4..305cf11 100644 --- a/Messages/PoseMsg.py +++ b/Messages/PoseMsg.py @@ -1,30 +1,30 @@ import Messages.LowLevelMessages -from Thing import Thing +#from Thing import Thing class PoseMsg(): id = 0x10 length = 4 - Pose_Position = 0x01 - Pose_Orientation = 0x02 - Pose_LinearVelocity = 0x04 - Pose_AngularVelocity = 0x08 + Position = 0x01 + Orientation = 0x02 + LinearVelocity = 0x04 + AngularVelocity = 0x08 def __init__(self, network_id, thing, force: bool = False): self.network_id = network_id - self.thing: Thing = thing + self.thing = thing self.pose_type = 0 if thing.position_updated or force: - self.pose_type |= Thing.Position + self.pose_type |= PoseMsg.Position thing.position_updated = False if thing.orientation_updated or force: - self.pose_type |= Thing.Orientation + self.pose_type |= PoseMsg.Orientation thing.orientation_updated = False if thing.linear_velocity_updated: - self.pose_type |= Thing.LinearVelocity + self.pose_type |= PoseMsg.LinearVelocity thing.linear_velocity_updated = False if thing.angular_velocity_updated: - self.pose_type |= Thing.AngularVelocity + self.pose_type |= PoseMsg.AngularVelocity thing.angular_velocity_updated = False def Serialize(self, buffer_ref): @@ -39,12 +39,12 @@ class PoseMsg(): self.pose_type ] ix = [4] - if self.pose_type & Thing.Position: + if self.pose_type & PoseMsg.Position: Messages.LowLevelMessages.SendSpherical(buffer, ix, self.thing.position) - if self.pose_type & Thing.Orientation: + if self.pose_type & PoseMsg.Orientation: Messages.LowLevelMessages.SendQuat32(buffer, ix, self.thing.orientation) - if self.pose_type & Thing.LinearVelocity: + if self.pose_type & PoseMsg.LinearVelocity: Messages.LowLevelMessages.SendSpherical(buffer, ix, self.thing.linear_velocity) - if self.pose_type & Thing.AngularVelocity: + if self.pose_type & PoseMsg.AngularVelocity: Messages.LowLevelMessages.SendSpherical(buffer, ix, self.thing.angular_velocity) return PoseMsg.length + ix[0] diff --git a/README.md b/README.md index 3d9afa2..19bec6e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,6 @@ Supporting: # Basic components -- \ref RoboidControl-python::Thing::Thing "Thing.Thing" -- \ref RoboidControl-python::LocalParticipant::LocalParticipant "LocalParticipant.LocalParticipant" -- \ref RoboidControl-python::SiteServer::SiteServer "SiteServer.SiteServer" \ No newline at end of file +- \ref RoboidControl::Thing::Thing "Thing" +- \ref RoboidControl::LocalParticipant::LocalParticipant "LocalParticipant" +- \ref RoboidControl::SiteServer::SiteServer "SiteServer" \ No newline at end of file diff --git a/SiteServer.py b/SiteServer.py index 35c9411..6c606ff 100644 --- a/SiteServer.py +++ b/SiteServer.py @@ -46,7 +46,7 @@ class SiteServer(LocalParticipant): self.others.append(remote_participant) return remote_participant - def ProcessClientMsg(self, sender, msg): + def ProcessParticipantMsg(self, sender, msg): if msg.network_id == 0: print(f'{self.name} received New Client -> {sender.network_id}') sender.Send(NetworkIdMsg(sender.network_id)) diff --git a/Thing.py b/Thing.py index fd3564a..ea881fa 100644 --- a/Thing.py +++ b/Thing.py @@ -1,5 +1,7 @@ -from LinearAlgebra.Spherical import Spherical -from LinearAlgebra.Quaternion import Quaternion +from LinearAlgebra.Spherical import * +from LinearAlgebra.Quaternion import * +from LinearAlgebra.SwingTwist import * +from Messages import * class Thing: """! A thing is the basic building block""" @@ -61,19 +63,37 @@ class Thing: self.owner.Add(self) def SetPosition(self, position): + """! Set the position of the thing + @param position The new position in local space, in meters + """ self.position = position self.position_updated = True + + def SetOrientation(self, orientation): + """! Set the orientation of the thing + @param orientation The new orientation in local space + """ + self.orientation = orientation + self.orientation_updated = True def SetLinearVelocity(self, linear_velocity): + """! Set the linear velocity of the thing + @param linearVelocity The new linear velocity in local space, in meters per second + """ self.linear_velocity = linear_velocity self.linear_velocity_updated = True def SetAngularVelocity(self, angular_velocity): + """! Set the angular velocity of the thing + @param angularVelocity the new angular velocity in local space + """ self.angular_velocity = angular_velocity self.angular_velocity_updated = True def Update(self, currentTime): - pass + pose_msg = PoseMsg(self.network_id, self) + for other in self.owner.others: + self.owner.Send(other, pose_msg) def ProcessBinary(self, data): print('default binary processor') @@ -96,4 +116,7 @@ class Thing: self.children.append(child) def RemoveChild(self, child): - self.children.remove(child) \ No newline at end of file + self.children.remove(child) + + def GenerateBinary(self, buffer, ix_ref): + pass \ No newline at end of file