diff --git a/src/tf/BaseTFClient.ts b/src/tf/BaseTFClient.ts index b4807cf7d..6d18b41df 100644 --- a/src/tf/BaseTFClient.ts +++ b/src/tf/BaseTFClient.ts @@ -1,6 +1,7 @@ import Transform from "../math/Transform.js"; import Ros from "../core/Ros.js"; import { tf2_msgs } from "../types/tf2_msgs.js"; +import { std_msgs } from "../types/std_msgs.js"; /** * Base class for TF Clients that provides common functionality. @@ -17,10 +18,7 @@ export default class BaseTFClient { transThres: number; rate: number; updateDelay: number; - topicTimeout: { - sec: number; - nsec: number; - }; + topicTimeout: std_msgs.time; serverName: string; /** @@ -64,8 +62,8 @@ export default class BaseTFClient { const secs = Math.floor(seconds); const nsecs = Math.floor((seconds - secs) * 1000000000); this.topicTimeout = { - sec: secs, - nsec: nsecs, + secs: secs, + nsecs: nsecs, }; this.serverName = serverName; } diff --git a/src/types/tf2_web_republisher.ts b/src/types/tf2_web_republisher.ts index cc28481ea..1d516d583 100644 --- a/src/types/tf2_web_republisher.ts +++ b/src/types/tf2_web_republisher.ts @@ -1,11 +1,9 @@ import { geometry_msgs } from "./geometry_msgs"; +import { std_msgs } from "./std_msgs"; export namespace tf2_web_republisher { export interface RepublishTFsRequest extends TFSubscriptionGoal { - timeout: { - sec: number; - nsec: number; - }; + timeout: std_msgs.time; } export interface RepublishTFsResponse { diff --git a/test/examples/params.examples.ts b/test/examples/params.example.ts similarity index 100% rename from test/examples/params.examples.ts rename to test/examples/params.example.ts diff --git a/vite.config.ts b/vite.config.ts index 614bd1cf0..68b94b660 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -41,10 +41,7 @@ export default defineConfig({ target: "node18", }, test: { - include: [ - "{src,test}/**/*.{test,spec}.?(c|m)[jt]s?(x)", - "./test/examples/*.js", - ], + include: ["{src,test}/**/*.{test,spec,example}.?(c|m)[jt]s?(x)"], exclude: ["dist"], globalSetup: "./test/setup/vitest-setup.js", projects: [