Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/actionlib/Goal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export default class Goal<T> extends EventEmitter {
this.goalMessage = {
goal_id: {
stamp: {
sec: 0,
nsec: 0,
secs: 0,
nsecs: 0,
},
id: this.goalID,
},
Expand Down
8 changes: 4 additions & 4 deletions src/actionlib/SimpleActionServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}[]} */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/types/actionlib_msgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion src/types/std_msgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good comment

export interface time {
secs: number;
nsecs: number;
}
}