@@ -82,15 +82,14 @@ export default class Action<
8282 }
8383 } ) ;
8484
85- const call = {
85+ this . ros . callOnConnection ( {
8686 op : "send_action_goal" ,
8787 id : actionGoalId ,
8888 action : this . name ,
8989 action_type : this . actionType ,
9090 args : goal ,
9191 feedback : true ,
92- } ;
93- this . ros . callOnConnection ( call ) ;
92+ } ) ;
9493
9594 return actionGoalId ;
9695 }
@@ -101,12 +100,11 @@ export default class Action<
101100 * @param id - The ID of the action goal to cancel.
102101 */
103102 cancelGoal ( id : string ) {
104- const call = {
103+ this . ros . callOnConnection ( {
105104 op : "cancel_action_goal" ,
106105 id : id ,
107106 action : this . name ,
108- } ;
109- this . ros . callOnConnection ( call ) ;
107+ } ) ;
110108 }
111109
112110 /**
@@ -200,13 +198,12 @@ export default class Action<
200198 * @param feedback - The feedback to send.
201199 */
202200 sendFeedback ( id : string , feedback : TFeedback ) {
203- const call = {
201+ this . ros . callOnConnection ( {
204202 op : "action_feedback" ,
205203 id : id ,
206204 action : this . name ,
207205 values : feedback ,
208- } ;
209- this . ros . callOnConnection ( call ) ;
206+ } ) ;
210207 }
211208
212209 /**
@@ -216,15 +213,14 @@ export default class Action<
216213 * @param result - The result to set.
217214 */
218215 setSucceeded ( id : string , result : TResult ) {
219- const call = {
216+ this . ros . callOnConnection ( {
220217 op : "action_result" ,
221218 id : id ,
222219 action : this . name ,
223220 values : result ,
224221 status : GoalStatus . STATUS_SUCCEEDED ,
225222 result : true ,
226- } ;
227- this . ros . callOnConnection ( call ) ;
223+ } ) ;
228224 }
229225
230226 /**
@@ -234,15 +230,14 @@ export default class Action<
234230 * @param result - The result to set.
235231 */
236232 setCanceled ( id : string , result : TResult ) {
237- const call = {
233+ this . ros . callOnConnection ( {
238234 op : "action_result" ,
239235 id : id ,
240236 action : this . name ,
241237 values : result ,
242238 status : GoalStatus . STATUS_CANCELED ,
243239 result : true ,
244- } ;
245- this . ros . callOnConnection ( call ) ;
240+ } ) ;
246241 }
247242
248243 /**
@@ -252,11 +247,11 @@ export default class Action<
252247 */
253248 setFailed ( id : string ) {
254249 const call = {
255- op : "action_result" ,
250+ op : "action_result" as const ,
256251 id : id ,
257252 action : this . name ,
258253 status : GoalStatus . STATUS_ABORTED ,
259- result : false ,
254+ result : false as const ,
260255 } ;
261256 this . ros . callOnConnection ( call ) ;
262257 }
0 commit comments