Skip to content

tu-darmstadt-ros-pkg/blob_tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

blob_tools

blob provides a new message type blob/Blob for binary data.

Currently, only roscpp is supported. Other client libraries like rospy will serialize/deserialize blob data as uint8[], as defined in the message definition.

Usage Example

MyMessage.msg:

blob/Blob map_blob      # a serialized (and compressed) nav_msgs/OccupancyGridMap

Publisher:

{
    ...
    MyMessage temp;
    nav_msgs::OccupancyGridMap my_map;
    ...
    temp.map_blob.serialize(my_map);
    temp.map_blob.setCompressed(true); // enable compression
    ...
    publisher.publish(temp);
}

Subscriber:

void callback(const MyMessageConstPtr& msg)
{
    // WARNING: instantiation of the "wrong" data type may result in non-sense data and/or StreamOverrunExceptions
    // blob/Blob is not type-safe!
    nav_msgs::OccupancyGridMapPtr my_map = msg->map_blob.instantiate<nav_msgs::OccupancyGridMap>();
    
    if (my_map) {
        ....
    }
}

About

blob provides a new message type blob/Blob for binary data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages