Coder Social home page Coder Social logo

ros2_introspection's Introduction

ros2_introspection

Spiritual successor of ros_type_introspection for ROS2.

It allows the user to convert a ROS2 message into a vector of (string/value) pairs, even if its type is not known at compilation-time.

It leverages the nice work done by other people, in particular Fast-CDR and rosbag2.

Typical usage:

// you want to deserialize this:
// rmw_serialized_message_t* serialized_message; 

Ros2Introspection::Parser parser;
// register **once** your type
parser.registerMessageType("imu", "sensor_msgs/Imu");

Ros2Introspection::FlatMessage flat_msg;
unsigned max_array_size = 100;
parser.deserializeIntoFlatMessage("imu", serialized_msg, &flat_msg, max_array_size);  
  
// you can show the entire content of the message as a list of key-values
for(const auto& pair: flat_msg.values)
{
  std::cout << pair.first.toStdString() << " = " << pair.second << std::endl;
}
for(const auto& pair: flat_msg.strings)
{
  std::cout << pair.first.toStdString() << " = " << pair.second << std::endl;
}

ros2_introspection's People

Contributors

1r0b1n0 avatar facontidavide avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.