-
Notifications
You must be signed in to change notification settings - Fork 3
[Communication] PR2: Set up IADS proxy for Mailbox use #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Joseph0120
wants to merge
28
commits into
master
Choose a base branch
from
joseph/communication_delay_PR2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
39a0f69
[Communication] Added Latency Table.
Joseph0120 3cda0d9
[Communication] Added Message base envelope. Message.cs.
Joseph0120 654200d
[Communication] Created IMessagePayload and MessagePayload.
Joseph0120 817b527
[Communication] Created PendingMessage.cs.
Joseph0120 7df0a54
[Comms_Proto] Minor Fix: format
Joseph0120 3c1451f
[Comms_Proto] Fixing LatencyTable enum casting
Joseph0120 c9b5442
[Comms_Proto] PendingMessage.cs extends IComparable
Joseph0120 d355a1d
[Comms_Proto] Minor Fix: LatencyTable
Joseph0120 0ea3e23
[Comms_Proto] Minor Fix: Format
Joseph0120 6072c61
Apply formatting and regenerate proto files
Joseph0120 635f3ba
Delete Assets/Scripts/Agents/Messaging/IMessagePayload.cs.meta
Joseph0120 ff380c4
Delete Assets/Scripts/Agents/Messaging/LatencyTable.cs.meta
Joseph0120 5796d89
Delete Assets/Scripts/Agents/Messaging/LatencyTable.cs
Joseph0120 50f13a2
Delete Assets/Scripts/Agents/Messaging/Message.cs.meta
Joseph0120 2eef48a
Delete Assets/Scripts/Agents/Messaging/MessagePayload.cs.meta
Joseph0120 f51564d
Delete Assets/Scripts/Agents/Messaging.meta
Joseph0120 fef6709
[Communication] Resolved git comments
Joseph0120 2df0800
[Communication] Set up IADS proxy for Mailbox use.
Joseph0120 c0da0a5
[Communication] Updated CodeRabbit Comments
Joseph0120 78f72d1
[Communication] Implemented new versio for IadsCommsAgent, supporting…
Joseph0120 8ed1ce6
[Communication] Passed all IadsCommsAgent Tests
Joseph0120 031b71f
fixed coderaddit comments and updated tests.
Joseph0120 f84bd33
[Communication] Fixed Compilation Error
Joseph0120 69baf46
[Packages] Revert packages-lock changes
Joseph0120 63f4f99
[Communication] Update Unity, and PR2 follow PR1 communication format
Joseph0120 79af713
[Communication] Added Meta Files and Updated Library directory
Joseph0120 d9dbe89
[Communication] Regenerated particle pack directory
Joseph0120 de5967d
[Communication] Fixed Titan's Comments
Joseph0120 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| using System; | ||
| using UnityEngine; | ||
|
|
||
| // IADS proxy for supporting mailbox message sending and receiving. | ||
|
|
||
| public class IadsCommsAgent : MonoBehaviour, IAgent { | ||
| public event AgentTerminatedEventHandler OnTerminated; | ||
|
|
||
| // Hierarchical node linked to the IADS mailbox endpoint. | ||
| [SerializeReference] | ||
| private HierarchicalAgent _hierarchicalAgent; | ||
|
|
||
| // Placeholder velocity set to zero for IADS. | ||
| [SerializeField] | ||
| private Vector3 _velocity = Vector3.zero; | ||
|
|
||
| // Placeholder acceleration set to zero for IADS. | ||
| [SerializeField] | ||
| private Vector3 _acceleration = Vector3.zero; | ||
|
|
||
| // Placeholder accelerationInput set to zero for IADS. | ||
| [SerializeField] | ||
| private Vector3 _accelerationInput = Vector3.zero; | ||
|
Joseph0120 marked this conversation as resolved.
|
||
|
|
||
| public HierarchicalAgent HierarchicalAgent { | ||
| get => _hierarchicalAgent; | ||
| set => _hierarchicalAgent = value; | ||
| } | ||
|
tryuan99 marked this conversation as resolved.
|
||
|
|
||
| public Configs.StaticConfig StaticConfig { get; set; } | ||
| public Configs.AgentConfig AgentConfig { get; set; } | ||
| public IMovement Movement { get; set; } | ||
| public IController Controller { get; set; } | ||
| public ISensor Sensor { get; set; } | ||
| public IAgent TargetModel { get; set; } | ||
|
|
||
| public Vector3 Position { | ||
| get => transform.position; | ||
| set => transform.position = value; | ||
| } | ||
|
|
||
| public Vector3 Velocity { | ||
| get => _velocity; | ||
| set => _velocity = value; | ||
| } | ||
|
|
||
| public float Speed => _velocity.magnitude; | ||
|
|
||
| public Vector3 Acceleration { | ||
| get => _acceleration; | ||
| set => _acceleration = value; | ||
| } | ||
|
|
||
| public Vector3 AccelerationInput { | ||
| get => _accelerationInput; | ||
| set => _accelerationInput = value; | ||
| } | ||
|
|
||
| public bool IsPursuer => false; | ||
|
|
||
| // Setting ElpasedTime has to be dependent on SimManager to have uniform clock time. | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| public float ElapsedTime => | ||
| SimManager.Instance?.ElapsedTime ?? | ||
| throw new InvalidOperationException( | ||
| $"{nameof(IadsCommsAgent)} requires {nameof(SimManager)} to provide deterministic simulation time."); | ||
| public bool IsTerminated { get; private set; } = false; | ||
|
|
||
| public Transform Transform => transform; | ||
| public Vector3 Up => transform.up; | ||
| public Vector3 Forward => transform.forward; | ||
| public Vector3 Right => transform.right; | ||
| public Quaternion InverseRotation => Quaternion.Inverse(transform.rotation); | ||
|
|
||
| public float MaxForwardAcceleration() { | ||
| throw CreateUnsupportedException(nameof(MaxForwardAcceleration)); | ||
| } | ||
|
|
||
| public float MaxNormalAcceleration() { | ||
| throw CreateUnsupportedException(nameof(MaxNormalAcceleration)); | ||
| } | ||
|
|
||
| public void CreateTargetModel(IHierarchical target) { | ||
| throw CreateUnsupportedException(nameof(CreateTargetModel)); | ||
| } | ||
|
|
||
| public void DestroyTargetModel() { | ||
| throw CreateUnsupportedException(nameof(DestroyTargetModel)); | ||
| } | ||
|
|
||
| public void UpdateTargetModel() { | ||
| throw CreateUnsupportedException(nameof(UpdateTargetModel)); | ||
| } | ||
|
|
||
| public void Terminate() { | ||
| if (IsTerminated) { | ||
| return; | ||
| } | ||
| IsTerminated = true; | ||
| OnTerminated?.Invoke(this); | ||
| } | ||
|
|
||
| public Transformation GetRelativeTransformation(IAgent target) { | ||
| throw CreateUnsupportedException($"{nameof(GetRelativeTransformation)}(IAgent)"); | ||
| } | ||
|
|
||
| public Transformation GetRelativeTransformation(IHierarchical target) { | ||
| throw CreateUnsupportedException($"{nameof(GetRelativeTransformation)}(IHierarchical)"); | ||
| } | ||
|
|
||
| public Transformation GetRelativeTransformation(in Vector3 waypoint) { | ||
| throw CreateUnsupportedException($"{nameof(GetRelativeTransformation)}(Vector3)"); | ||
| } | ||
|
|
||
| private NotSupportedException CreateUnsupportedException(string memberName) { | ||
| string targetModelState = | ||
| TargetModel == null | ||
| ? " TargetModel is null on this proxy." | ||
| : " TargetModel is set on this proxy, which indicates the mailbox-only IADS proxy is being used as a physical agent."; | ||
| return new NotSupportedException( | ||
| $"{nameof(IadsCommsAgent)}.{memberName} is unsupported because {nameof(IadsCommsAgent)} is a comms-only mailbox proxy, not a physical/sensing agent.{targetModelState}"); | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not inherit from AgentBase or even DummyAgent?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought AgentBase is only for physical agents (ie. mass and velocity and other parameters). Goal of IadsCommsAgent is just to add a communication "interface" for the IADS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily, I think. Right now, you're implementing a lot of pieces of the interface that make it seem like a dummy agent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you addressed this? @Joseph0120