@@ -87,13 +87,15 @@ public static bool IsAnalyticsEnabled()
87
87
/// <param name="inferenceDevice">Whether inference is being performed on the CPU or GPU</param>
88
88
/// <param name="sensors">List of ISensors for the Agent. Used to generate information about the observation space.</param>
89
89
/// <param name="actionSpec">ActionSpec for the Agent. Used to generate information about the action space.</param>
90
+ /// <param name="actuators">List of IActuators for the Agent. Used to generate information about the action space.</param>
90
91
/// <returns></returns>
91
92
public static void InferenceModelSet (
92
93
NNModel nnModel ,
93
94
string behaviorName ,
94
95
InferenceDevice inferenceDevice ,
95
96
IList < ISensor > sensors ,
96
- ActionSpec actionSpec
97
+ ActionSpec actionSpec ,
98
+ IList < IActuator > actuators
97
99
)
98
100
{
99
101
// The event shouldn't be able to report if this is disabled but if we know we're not going to report
@@ -112,9 +114,9 @@ ActionSpec actionSpec
112
114
return ;
113
115
}
114
116
115
- var data = GetEventForModel ( nnModel , behaviorName , inferenceDevice , sensors , actionSpec ) ;
117
+ var data = GetEventForModel ( nnModel , behaviorName , inferenceDevice , sensors , actionSpec , actuators ) ;
116
118
// Note - to debug, use JsonUtility.ToJson on the event.
117
- //Debug.Log(JsonUtility.ToJson(data, true));
119
+ // Debug.Log(JsonUtility.ToJson(data, true));
118
120
#if UNITY_EDITOR
119
121
if ( AnalyticsUtils . s_SendEditorAnalytics )
120
122
{
@@ -133,13 +135,15 @@ ActionSpec actionSpec
133
135
/// <param name="inferenceDevice"></param>
134
136
/// <param name="sensors"></param>
135
137
/// <param name="actionSpec"></param>
138
+ /// <param name="actuators"></param>
136
139
/// <returns></returns>
137
140
internal static InferenceEvent GetEventForModel (
138
141
NNModel nnModel ,
139
142
string behaviorName ,
140
143
InferenceDevice inferenceDevice ,
141
144
IList < ISensor > sensors ,
142
- ActionSpec actionSpec
145
+ ActionSpec actionSpec ,
146
+ IList < IActuator > actuators
143
147
)
144
148
{
145
149
var barracudaModel = ModelLoader . Load ( nnModel ) ;
@@ -175,6 +179,12 @@ ActionSpec actionSpec
175
179
inferenceEvent . ObservationSpecs . Add ( EventObservationSpec . FromSensor ( sensor ) ) ;
176
180
}
177
181
182
+ inferenceEvent . ActuatorInfos = new List < EventActuatorInfo > ( actuators . Count ) ;
183
+ foreach ( var actuator in actuators )
184
+ {
185
+ inferenceEvent . ActuatorInfos . Add ( EventActuatorInfo . FromActuator ( actuator ) ) ;
186
+ }
187
+
178
188
inferenceEvent . TotalWeightSizeBytes = GetModelWeightSize ( barracudaModel ) ;
179
189
inferenceEvent . ModelHash = GetModelHash ( barracudaModel ) ;
180
190
return inferenceEvent ;
0 commit comments