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
8 changes: 8 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ export default defineConfig(
"@typescript-eslint/no-empty-function": 0,
"prefer-template": 2,
"@typescript-eslint/consistent-type-imports": 2,
"no-restricted-syntax": [
"error",
{
selector: "CallExpression[callee.property.name='bind']",
message:
"Prefer arrow functions over invoking Function.prototype.bind",
},
],
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/Action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ export default class Action<
this.#actionCallback = actionCallback;
this.#cancelCallback = cancelCallback;
this.ros.on(this.name, (msg) => {
if (isRosbridgeSendActionGoalMessage(msg)) {
this.#executeAction.bind(this);
if (isRosbridgeSendActionGoalMessage<TGoal>(msg)) {
this.#executeAction(msg);
} else {
throw new Error(
"Received unrelated message on Action server event stream!",
Expand Down
4 changes: 2 additions & 2 deletions src/types/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ export interface RosbridgeSendActionGoalMessage<TArgs = unknown>
compression?: string;
}

export function isRosbridgeSendActionGoalMessage(
export function isRosbridgeSendActionGoalMessage<TArgs = unknown>(
message: RosbridgeMessageBase,
): message is RosbridgeSendActionGoalMessage {
): message is RosbridgeSendActionGoalMessage<TArgs> {
return message.op === "send_action_goal";
}

Expand Down