Skip to content

Commit

Permalink
Remove truck controls, set obj id and class id (#70)
Browse files Browse the repository at this point in the history
* Removed retro_log

* Removed the retro log dir

* Fixed texture leak in sim

* Remove truck controls, set obj id and class id
  • Loading branch information
telemething authored Oct 13, 2021
1 parent 918fef7 commit 07b1da5
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 48 deletions.
102 changes: 55 additions & 47 deletions KomatsuSimulator/Assets/Scenes/Scenario2.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1478,108 +1478,116 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6100550845703879732, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550845703879732, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550845703879732, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 160
objectReference: {fileID: 0}
- target: {fileID: 6100550845703879732, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 31.504831
objectReference: {fileID: 0}
- target: {fileID: 6100550845703879732, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6100550845703879732, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -10
objectReference: {fileID: 0}
- target: {fileID: 6100550846288094405, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6100550846288094405, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550846288094405, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550846288094405, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 140
objectReference: {fileID: 0}
- target: {fileID: 6100550846288094405, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 26.50483
objectReference: {fileID: 0}
- target: {fileID: 6100550846288094405, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6100550846288094405, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -129.5145
objectReference: {fileID: 0}
- target: {fileID: 6100550846340665528, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6100550846340665528, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550846340665528, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550846340665528, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 160
objectReference: {fileID: 0}
- target: {fileID: 6100550846340665528, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 166.01932
objectReference: {fileID: 0}
- target: {fileID: 6100550846340665528, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6100550846340665528, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.y
value: -93.00966
objectReference: {fileID: 0}
- target: {fileID: 6100550846391146277, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6100550846391146282, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550846391146282, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550846391146282, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 269.029
objectReference: {fileID: 0}
- target: {fileID: 6100550846391146282, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6100550846391146282, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -10
objectReference: {fileID: 0}
- target: {fileID: 6100550846582550105, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_Name
value: UI
objectReference: {fileID: 0}
- target: {fileID: 6100550846582550105, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550846582550109, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_Pivot.x
value: 0
Expand Down Expand Up @@ -1690,111 +1698,111 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6100550846614828753, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550846614828753, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550846614828753, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 140
objectReference: {fileID: 0}
- target: {fileID: 6100550846614828753, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 26.50483
objectReference: {fileID: 0}
- target: {fileID: 6100550846614828753, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6100550846614828753, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -10
objectReference: {fileID: 0}
- target: {fileID: 6100550846872089348, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6100550846872089348, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550846872089348, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550846872089348, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 160
objectReference: {fileID: 0}
- target: {fileID: 6100550846872089348, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 31.504831
objectReference: {fileID: 0}
- target: {fileID: 6100550846872089348, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6100550846872089348, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -51.50483
objectReference: {fileID: 0}
- target: {fileID: 6100550847257495159, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6100550847257495159, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550847257495159, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550847257495159, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 140
objectReference: {fileID: 0}
- target: {fileID: 6100550847257495159, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 31.50483
objectReference: {fileID: 0}
- target: {fileID: 6100550847257495159, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6100550847257495159, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -88.00966
objectReference: {fileID: 0}
- target: {fileID: 6100550847513206136, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6100550847513206136, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550847513206136, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6100550847513206136, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 140
objectReference: {fileID: 0}
- target: {fileID: 6100550847513206136, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 31.50483
objectReference: {fileID: 0}
- target: {fileID: 6100550847513206136, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6100550847513206136, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -46.50483
objectReference: {fileID: 0}
- target: {fileID: 6543429262768960798, guid: ca81b5e5df6f29051a9653b63cba8147, type: 3}
propertyPath: m_AnchorMax.y
Expand Down Expand Up @@ -3526,7 +3534,7 @@ MonoBehaviour:
ScanAngleStartDegrees: -90
ScanAngleEndDegrees: 90
ScanOffsetAfterPublish: 0
NumMeasurementsPerScan: 180
NumMeasurementsPerScan: 90
TimeBetweenMeasurementsSeconds: 0
markerPrefab: {fileID: 7151730531324999659, guid: 32e2a897b3516fe70a4665a0b7d92eb2, type: 3}
LayerMaskName: Shovel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ private RosMessageTypes.BuiltinInterfaces.TimeMsg GetRosTime()
return new RosMessageTypes.BuiltinInterfaces.TimeMsg((int)span.TotalSeconds, (uint)(span.Ticks * 100));
}

private string RemoveParenNumber(string nameIn)
{
var li = nameIn.LastIndexOf('(');

if(0 > li)
return nameIn;

return nameIn.Substring(0,li).Trim();
}

public RosMessageTypes.Vision.Detection3DArrayMsg FindAllObjects(string tagName)
{
RosMessageTypes.Vision.Detection3DArrayMsg detectedObjectArray =
Expand Down Expand Up @@ -111,11 +121,12 @@ public RosMessageTypes.Vision.Detection3DArrayMsg FindAllObjects(string tagName)
detectedObjectArray.detections[index].header = new RosMessageTypes.Std.HeaderMsg(rosTime, rosFrame);
detectedObjectArray.detections[index].bbox = new RosMessageTypes.Vision.BoundingBox3DMsg(center, size);
detectedObjectArray.detections[index].results = new RosMessageTypes.Vision.ObjectHypothesisWithPoseMsg[1];
detectedObjectArray.detections[index].id = go.name;

//*** TODO : game object name is not correct here. We want an object type, like 'person' or 'truck'. Maybe we
//*** can use a tag for this.

var hyp = new RosMessageTypes.Vision.ObjectHypothesisMsg(go.name, 1.0);
var hyp = new RosMessageTypes.Vision.ObjectHypothesisMsg(RemoveParenNumber(go.name), 1.0);
var pwc = new RosMessageTypes.Geometry.PoseWithCovarianceMsg(center, covariance);

detectedObjectArray.detections[index].results[0] =
Expand Down

0 comments on commit 07b1da5

Please sign in to comment.