Skip to content

Commit

Permalink
First Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Jarvis committed Jul 25, 2024
1 parent 89cbdda commit 0245e20
Show file tree
Hide file tree
Showing 28 changed files with 4,765 additions and 146 deletions.
6 changes: 6 additions & 0 deletions .vsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}
2 changes: 1 addition & 1 deletion Assets/3rd-Party/ML-Agents/Scripts/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ public static void ObservationToTexture(Camera obsCamera, int width, int height,

if (width != texture2D.width || height != texture2D.height)
{
texture2D.Resize(width, height);
texture2D.Reinitialize(width, height);
}

var prevActiveRT = RenderTexture.active;
Expand Down
1 change: 1 addition & 0 deletions Assets/Resources/BillingMode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"androidStore":"GooglePlay"}
7 changes: 7 additions & 0 deletions Assets/Resources/BillingMode.json.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Assets/Scripts/DroneAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public float normalizedHeader(Vector3 gpsCurr, Vector3 gpsTarg) {
public override void CollectObservations()
{
// List<float> state = new List<float>();
//Debug.Log("CALLED");
Debug.Log("CALLED");

//NEW STATE
//do this in collect state so we make sure we don't miss it
Expand Down Expand Up @@ -221,7 +221,9 @@ public override void AgentAction(float[] vectorAction, string textAction)
// add in code logic for drone control
// basicControl.Controller.InputAction(0, act[0], act[1], act[2]);

//Debug.Log (act);
// Debug.Log (act);

Debug.Log("ACTION");

// float angle = normalizedHeader (transform.position, endRegion.transform.position);
// Debug.Log (angle);
Expand Down
14 changes: 9 additions & 5 deletions Assets/Scripts/VelocityControl/InputControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ void Start () {

// Update is called once per frame
void FixedUpdate () {
// vc.desired_vx = Input.GetAxisRaw ("Pitch")*4.0f;
// vc.desired_vy = Input.GetAxisRaw ("Roll")*4.0f;
// vc.desired_yaw = Input.GetAxisRaw ("Yaw")*0.5f;
// abs_height += Input.GetAxisRaw("Throttle") * 0.1f;

// Log the pitch, roll, yaw, and throttle inputs
Debug.Log("Pitch: " + Input.GetAxis("Pitch") + " Roll: " + Input.GetAxis("Roll") + " Yaw: " + Input.GetAxis("Yaw") + " Throttle: " + Input.GetAxis("Throttle"));

vc.desired_vx = Input.GetAxisRaw ("Pitch")*4.0f;
vc.desired_vy = Input.GetAxisRaw ("Roll")*4.0f;
vc.desired_yaw = Input.GetAxisRaw ("Yaw")*0.5f;
abs_height += Input.GetAxisRaw("Throttle") * 0.1f;
//
// vc.desired_height = abs_height;
vc.desired_height = abs_height;
}
}
4 changes: 3 additions & 1 deletion Assets/Scripts/VelocityControl/VelocityControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void FixedUpdate () {
state.GetState ();

// NOTE: I'm using stupid vector order (sideways, up, forward) at the end

Vector3 desiredTheta;
Vector3 desiredOmega;

Expand All @@ -56,6 +56,8 @@ void FixedUpdate () {
Vector3 desiredVelocity = new Vector3 (desired_vy, -1.0f * heightError / time_constant_z_velocity, desired_vx);
Vector3 velocityError = state.VelocityVector - desiredVelocity;

Debug.Log("desiredVelocity: " + desiredVelocity);

Vector3 desiredAcceleration = velocityError * -1.0f / time_constant_acceleration;

desiredTheta = new Vector3 (desiredAcceleration.z / gravity, 0.0f, -desiredAcceleration.x / gravity);
Expand Down
13 changes: 10 additions & 3 deletions Assets/Textures/minimap_rtex.renderTexture
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: minimap_rtex
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 5
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_DepthFormat: 2
m_ColorFormat: 0
m_MipCount: -1
m_DepthStencilFormat: 92
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_EnableRandomWrite: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
Expand All @@ -31,3 +37,4 @@ RenderTexture:
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
m_ShadowSamplingMode: 2
Loading

0 comments on commit 0245e20

Please sign in to comment.