Skip to content

Foxglove client example in typescript using ros-foxglove-bridge #990

Answered by jtbandes
EnzoGhisoni asked this question in Q&A
Discussion options

You must be logged in to vote
        const reader = new CdrReader(response.data);
        console.log(reader.string())

CDR is a low-level serialization format that is unaware of ROS messages. Reading a string() value out of the message would ignore the other fields of the message, namely the header. You probably want to use @foxglove/rosmsg2-serialization instead. See here for an example: https://github.com/foxglove/mcap/blob/b8a73890348ef2dc69272b377fd2faab56f0303f/typescript/examples/validate/scripts/validate.ts#L154-L158

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by defunctzombie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants