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
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,19 @@ Install roslibjs with any NPM-compatible package manager via, for example,
npm install roslib
```

~Pre-built files can be found in either [roslib.js](build/roslib.js) or [roslib.min.js](build/roslib.min.js).~

As we are updating to v2, we don't provide pre-built files anymore in the repo.

Alternatively, you can use the v1 release via the [JsDelivr](https://www.jsdelivr.com/) CDN: ([full](https://cdn.jsdelivr.net/npm/roslib@1/build/roslib.js)) | ([min](https://cdn.jsdelivr.net/npm/roslib@1/build/roslib.min.js))
Comment on lines -21 to -25
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

typedoc was upset about the missing relative paths here, and I figured it was time to remove the rest also since it refers to v1.


## Troubleshooting

1. Check that connection is established. You can listen to error and
connection events to report them to console. See
examples/simple.html for a complete example:

```js
ros.on('error', function(error) { console.log( error ); });
ros.on('connection', function() { console.log('Connection made!'); });
ros.on("error", function (error) {
console.log(error);
});
ros.on("connection", function () {
console.log("Connection made!");
});
```

2. Check that you have the websocket server is running on
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"scripts": {
"build": "vite build",
"doc": "typedoc src/RosLib.ts",
"doc": "typedoc src/RosLib.ts --treatWarningsAsErrors",
"lint": "eslint .",
"test": "vitest",
"prepublishOnly": "npm run test",
Expand Down
24 changes: 21 additions & 3 deletions src/RosLib.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* @fileOverview
* @author Russell Toris - [email protected]
*/

/** @description Library version */
/** Library version */
export const REVISION = import.meta.env.VITE_ROSLIBJS_VERSION;

// Core exports
export { default as Ros } from "./core/Ros.js";
export { default as Ros, type TypeDefDict } from "./core/Ros.js";
export { default as Topic } from "./core/Topic.js";
export { default as Param } from "./core/Param.js";
export { default as Service } from "./core/Service.js";
export { default as Action } from "./core/Action.js";
export { type GoalStatus } from "./core/GoalStatus.js";

// Core Transport exports
export {
Expand Down Expand Up @@ -54,10 +54,28 @@ export {
default as UrdfVisual,
type UrdfGeometryLike,
} from "./urdf/UrdfVisual.js";
export { default as UrdfJoint } from "./urdf/UrdfJoint.js";

export {
UrdfAttrs,
UrdfType,
type UrdfDefaultOptions,
} from "./urdf/UrdfTypes.js";
export { isElement, parseUrdfOrigin } from "./urdf/UrdfUtils.js";

// only export the types that typedoc requires us to export - those are our public interfaces
export { type actionlib_msgs } from "./types/actionlib_msgs.js";
export { type tf2_web_republisher } from "./types/tf2_web_republisher.js";
export { type rosapi } from "./types/rosapi.js";
export { type std_msgs } from "./types/std_msgs.js";
export { type tf2_msgs } from "./types/tf2_msgs.js";
export { type geometry_msgs } from "./types/geometry_msgs.js";
export type { Nullable, PartialNullable } from "./types/interface-types.js";
export {
type RosbridgeMessage,
isRosbridgeMessage,
type RosbridgeAdvertiseMessage,
isRosbridgeAdvertiseMessage,
type RosbridgeSubscribeMessage,
isRosbridgeSubscribeMessage,
} from "./types/protocol.js";
2 changes: 1 addition & 1 deletion src/core/Ros.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import type {
} from "./transport/Transport.js";
import { WebSocketTransportFactory } from "./transport/WebSocketTransportFactory.ts";

interface TypeDefDict {
export interface TypeDefDict {
[key: string]: string | string[] | TypeDefDict | TypeDefDict[];
}

Expand Down
18 changes: 9 additions & 9 deletions src/types/rosapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export namespace rosapi {
name: string;
default?: string;
}
interface GetParamResponsePreJazzy {
export interface GetParamResponsePreJazzy {
value: string;
}
interface GetParamResponseFailedPostJazzy {
export interface GetParamResponseFailedPostJazzy {
value: never;
successful: false;
reason: string;
}
interface GetParamResponseSuccessPostJazzy {
export interface GetParamResponseSuccessPostJazzy {
value: string;
successful: true;
reason: never;
Expand All @@ -51,12 +51,12 @@ export namespace rosapi {
name: string;
value: string;
}
type SetParamResponsePreJazzy = Record<never, never>;
interface FailedSetParamResponsePostJazzy {
export type SetParamResponsePreJazzy = Record<never, never>;
export interface FailedSetParamResponsePostJazzy {
successful: false;
reason: string;
}
interface SuccessfulSetParamResponsePostJazzy {
export interface SuccessfulSetParamResponsePostJazzy {
successful: true;
reason: never;
}
Expand All @@ -67,12 +67,12 @@ export namespace rosapi {
export interface DeleteParamRequest {
name: string;
}
type DeleteParamResponsePreJazzy = Record<never, never>;
interface FailedDeleteParamResponsePostJazzy {
export type DeleteParamResponsePreJazzy = Record<never, never>;
export interface FailedDeleteParamResponsePostJazzy {
successful: false;
reason: string;
}
interface SuccessfulDeleteParamResponsePostJazzy {
export interface SuccessfulDeleteParamResponsePostJazzy {
successful: true;
reason: never;
}
Expand Down