Skip to content

Commit cb16abd

Browse files
authored
Merge pull request #4 from SoonerRobotics/fall2022
Added IGVC23 robot with new delta odom feedback messages
2 parents 040d32d + f65f130 commit cb16abd

32 files changed

+1413
-544
lines changed

Assets/Levels/IGVC 2022.asset renamed to Assets/Levels/IGVC Course.asset

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ MonoBehaviour:
1010
m_Enabled: 1
1111
m_EditorHideFlags: 0
1212
m_Script: {fileID: 11500000, guid: 79d992af8d293a346ade7e1113139280, type: 3}
13-
m_Name: IGVC 2022
13+
m_Name: IGVC Course
1414
m_EditorClassIdentifier:
15-
levelName: IGVC 2022
15+
levelName: IGVC Course
1616
levelId: 4
-10.9 KB
Loading

Assets/Materials/circle_logo_background.png.meta

Lines changed: 17 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Models/Drum/drum.prefab

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Transform:
2828
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
2929
m_LocalPosition: {x: 0, y: 0, z: 0}
3030
m_LocalScale: {x: 1, y: 1, z: 1}
31+
m_ConstrainProportionsScale: 0
3132
m_Children: []
3233
m_Father: {fileID: 4538124215614584225}
3334
m_RootOrder: 3
@@ -51,6 +52,7 @@ MeshRenderer:
5152
m_CastShadows: 1
5253
m_ReceiveShadows: 1
5354
m_DynamicOccludee: 1
55+
m_StaticShadowCaster: 0
5456
m_MotionVectors: 1
5557
m_LightProbeUsage: 1
5658
m_ReflectionProbeUsage: 1
@@ -109,6 +111,7 @@ Transform:
109111
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
110112
m_LocalPosition: {x: 0, y: 0, z: 0}
111113
m_LocalScale: {x: 1, y: 1, z: 1}
114+
m_ConstrainProportionsScale: 0
112115
m_Children: []
113116
m_Father: {fileID: 4538124215614584225}
114117
m_RootOrder: 1
@@ -132,6 +135,7 @@ MeshRenderer:
132135
m_CastShadows: 1
133136
m_ReceiveShadows: 1
134137
m_DynamicOccludee: 1
138+
m_StaticShadowCaster: 0
135139
m_MotionVectors: 1
136140
m_LightProbeUsage: 1
137141
m_ReflectionProbeUsage: 1
@@ -190,6 +194,7 @@ Transform:
190194
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
191195
m_LocalPosition: {x: 0, y: 0, z: 0}
192196
m_LocalScale: {x: 1, y: 1, z: 1}
197+
m_ConstrainProportionsScale: 0
193198
m_Children: []
194199
m_Father: {fileID: 4538124215614584225}
195200
m_RootOrder: 0
@@ -213,6 +218,7 @@ MeshRenderer:
213218
m_CastShadows: 1
214219
m_ReceiveShadows: 1
215220
m_DynamicOccludee: 1
221+
m_StaticShadowCaster: 0
216222
m_MotionVectors: 1
217223
m_LightProbeUsage: 1
218224
m_ReflectionProbeUsage: 1
@@ -269,6 +275,7 @@ Transform:
269275
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
270276
m_LocalPosition: {x: 0, y: 0, z: 0}
271277
m_LocalScale: {x: 1, y: 1, z: 1}
278+
m_ConstrainProportionsScale: 0
272279
m_Children:
273280
- {fileID: 5992179490751560582}
274281
- {fileID: 293815460969056204}
@@ -305,6 +312,7 @@ Transform:
305312
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
306313
m_LocalPosition: {x: 0, y: 0, z: 0}
307314
m_LocalScale: {x: 1, y: 1, z: 1}
315+
m_ConstrainProportionsScale: 0
308316
m_Children: []
309317
m_Father: {fileID: 4538124215614584225}
310318
m_RootOrder: 2
@@ -328,6 +336,7 @@ MeshRenderer:
328336
m_CastShadows: 1
329337
m_ReceiveShadows: 1
330338
m_DynamicOccludee: 1
339+
m_StaticShadowCaster: 0
331340
m_MotionVectors: 1
332341
m_LightProbeUsage: 1
333342
m_ReflectionProbeUsage: 1

Assets/Models/barrel/barrel.prefab

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Transform:
2626
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
2727
m_LocalPosition: {x: 0, y: 0, z: 0}
2828
m_LocalScale: {x: 1, y: 1, z: 1}
29+
m_ConstrainProportionsScale: 0
2930
m_Children:
3031
- {fileID: 2483449190887008458}
3132
m_Father: {fileID: 0}
@@ -59,6 +60,7 @@ Transform:
5960
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
6061
m_LocalPosition: {x: 0, y: 0, z: 0}
6162
m_LocalScale: {x: 1, y: 1, z: 1}
63+
m_ConstrainProportionsScale: 0
6264
m_Children: []
6365
m_Father: {fileID: 7745488649448463971}
6466
m_RootOrder: 0
@@ -82,6 +84,7 @@ MeshRenderer:
8284
m_CastShadows: 1
8385
m_ReceiveShadows: 1
8486
m_DynamicOccludee: 1
87+
m_StaticShadowCaster: 0
8588
m_MotionVectors: 1
8689
m_LightProbeUsage: 1
8790
m_ReflectionProbeUsage: 1
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
5+
namespace RosSharp.RosBridgeClient.MessageTypes.Autonav
6+
{
7+
public class IGVCMotorsSubscriberIGVC23 : UnitySubscriber<MotorInput>
8+
{
9+
private SimpleCarController car;
10+
11+
protected override void Start()
12+
{
13+
base.Start();
14+
car = GetComponent<SimpleCarController>();
15+
}
16+
17+
protected override void ReceiveMessage(MotorInput motors)
18+
{
19+
car.leftControl = motors.left_motor;
20+
car.rightControl = motors.right_motor;
21+
}
22+
}
23+
}
24+

Assets/ROSSharp Modules/IGVCMotorsSubscriberIGVC23.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
5+
namespace RosSharp.RosBridgeClient.MessageTypes.Autonav
6+
{
7+
public class VelocityPublisherIGVC23 : UnityPublisher<MotorFeedback>
8+
{
9+
private MotorFeedback message;
10+
private SimpleCarController c;
11+
public Rigidbody rb;
12+
13+
public float velocityNoiseStdDev = 0.05f;
14+
15+
protected override void Start()
16+
{
17+
base.Start();
18+
c = GetComponent<SimpleCarController>();
19+
message = new MotorFeedback();
20+
21+
velocityNoiseStdDev = ConfigLoader.Instance.sensors.encoders.velocityNoise;
22+
}
23+
public float getRandNormal(float mean, float stdDev)
24+
{
25+
float u1 = 1.0f - Random.value; //uniform(0,1] random doubles
26+
float u2 = 1.0f - Random.value;
27+
float randStdNormal = Mathf.Sqrt(-2.0f * Mathf.Log(u1)) *
28+
Mathf.Sin(2.0f * Mathf.PI * u2); //random normal(0,1)
29+
30+
return stdDev * randStdNormal;
31+
}
32+
33+
void FixedUpdate()
34+
{
35+
float delta_t = Time.fixedDeltaTime;
36+
// message.leftVel = c.vl + getRandNormal(0, velocityNoiseStdDev);
37+
// message.rightVel = c.vr + getRandNormal(0, velocityNoiseStdDev);
38+
39+
message.delta_theta = (float)((c.vr - c.vl) * 0.1016 / 0.4826) * delta_t;
40+
message.delta_x = (float)((c.vl + c.vr) / 2.0 * Mathf.Cos(message.delta_theta)) * delta_t;
41+
message.delta_y = (float)((c.vl + c.vr) / 2.0 * Mathf.Sin(message.delta_theta)) * delta_t;
42+
43+
Publish(message);
44+
}
45+
}
46+
}

Assets/ROSSharp Modules/VelocityPublisherIGVC23.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)