Comments (9)
The @foxglove/ros1 library connects directly as a ROS 1 node using rostcp. It only supports ROS 1, but a separate ROS 2 library is in progress. It sounds like roslibjs is the right fit for what you need right now. Looking forward to what you create.
from rosmsg.
Yep thanks - was very helpful.
I've made a very basic version here which includes generated types for ros2 foxy. Hoping I'll find the time to add some of the other features soon.
https://github.com/Greenroom-Robotics/ros-typescript-generator
from rosmsg.
This is definitely possible, but the best way to approach it depends on what you're trying to achieve. Do you want to do binary serialization or deserialization of ROS messages? Or do you just need TypeScript definitions for the structure of your messages but don't need to actually (de)serialize? If you need serialization or deserialization, you'll need to pair this library with https://github.com/foxglove/rosmsg-serialization.
You can find an example of TypeScript definition generation in https://github.com/foxglove/rosmsg-msgs-common/blob/main/src/index.ts. It would need to be adapted to use either roslibjs + the websocket bridge or https://github.com/foxglove/ros1 for a direct ROS connection, and query for all data types + message definitions before creating .d.ts
files.
If you provide more information about your use case I might be able to generalize it into an example tool we could include in one of these repos.
from rosmsg.
Thanks jhurliman.
That rosmsg-msgs-common
generation / parse logic looks perfect. I'll have a go making and open-sourcing a CLI.
I was initially thinking about using roslibjs
and simply annotating the topic.subscribe
so the de/serialisation is not so critical. What are the benefits of foxglove's ros lib over roslibjs? (I am primaily using ros2)
from rosmsg.
Sounds like above question has been answered so closing issue. Feel free to add comments or reopen if needed.
from rosmsg.
Very cool!
from rosmsg.
@jhurliman Any plans to tackle this? I see you re-opened it some time ago and self-assigned.
from rosmsg.
This would be a good item to bump up the list. I will queue it up for the next week or two.
from rosmsg.
After looking into this further, I'm going to close the ticket as not planned. The main challenge is getting concatenated message definitions. This requires either connecting to rosbridge, implementing the same directory traversing logic from ROS1 ala gendeps --cat
, and/or implementing ROS2 index parsing ala mcap convert
. This kind of socket code, filesystem traversal, and index parsing code is currently outside the scope of this repository. It would be better suited for a separate repo similar to the ros-typescript-generator linked in a previous comment.
from rosmsg.
Related Issues (9)
- ROS 2 constants valueText is incorrect for `bool A=False`
- Allow parsing message definitions with unresolved type names HOT 2
- Lazy message field access is dominated by <instance_members_initializer> HOT 3
- Support IDL-defined message schemas HOT 3
- Add support for ROS services (.srv) HOT 1
- Incorrectly Formated ROS 1 `definitionStr` in README.md HOT 2
- Types with same name are mixed up HOT 2
- Docmentation for running gendeps2 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rosmsg.