diff --git a/src/actionlib/Goal.ts b/src/actionlib/Goal.ts index a7ea2be48..2eed63d47 100644 --- a/src/actionlib/Goal.ts +++ b/src/actionlib/Goal.ts @@ -41,8 +41,8 @@ export default class Goal extends EventEmitter { this.goalMessage = { goal_id: { stamp: { - sec: 0, - nsec: 0, + secs: 0, + nsecs: 0, }, id: this.goalID, }, diff --git a/src/actionlib/SimpleActionServer.ts b/src/actionlib/SimpleActionServer.ts index 70f34599f..b16a2dfe0 100644 --- a/src/actionlib/SimpleActionServer.ts +++ b/src/actionlib/SimpleActionServer.ts @@ -97,7 +97,7 @@ export default class SimpleActionServer< // Track the goals and their status in order to publish status... this.statusMessage = { header: { - stamp: { sec: 0, nsec: 100 }, + stamp: { secs: 0, nsecs: 100 }, frame_id: "", }, /** @type {{goal_id: any, status: number}[]} */ @@ -143,8 +143,8 @@ export default class SimpleActionServer< cancelListener.subscribe((cancelMessage) => { // cancel ALL goals if both empty if ( - cancelMessage.stamp.sec === 0 && - cancelMessage.stamp.nsec === 0 && + cancelMessage.stamp.secs === 0 && + cancelMessage.stamp.nsecs === 0 && cancelMessage.id === "" ) { this.nextGoal = null; @@ -189,7 +189,7 @@ export default class SimpleActionServer< ); this.statusMessage.header = { ...this.statusMessage.header, - stamp: { sec: secs, nsec: nsecs }, + stamp: { secs, nsecs }, }; statusPublisher.publish(this.statusMessage); }, 500); // publish every 500ms diff --git a/src/types/actionlib_msgs.ts b/src/types/actionlib_msgs.ts index 0ad1594d0..d48423893 100644 --- a/src/types/actionlib_msgs.ts +++ b/src/types/actionlib_msgs.ts @@ -4,7 +4,7 @@ import { GoalStatus as GoalStatusEnum } from "../core/GoalStatus.js"; export namespace actionlib_msgs { export interface GoalID { id: string; - stamp: { sec: number; nsec: number }; + stamp: std_msgs.time; } export interface GoalStatus { goal_id: GoalID; diff --git a/src/types/std_msgs.ts b/src/types/std_msgs.ts index 89f7353a1..5888db015 100644 --- a/src/types/std_msgs.ts +++ b/src/types/std_msgs.ts @@ -2,7 +2,12 @@ export namespace std_msgs { // rosbridge fills this in with defaults if you leave them unspecified, which is common in roslibjs code, so we artificially make it a Partial export type ROS1Header = Partial<{ seq: number; - stamp: { sec: number; nsec: number }; + stamp: time; frame_id: string; }>; + // This is ROS 1 time. It is rectified to ROS 2 time by rosbridge_suite in-transit. We'll switch this to ROS 2 time when we drop ROS 1 support. + export interface time { + secs: number; + nsecs: number; + } }