Load binary data into a PostgreSQL database through the database_interface [closed]
Hello,
The database_interface package appears to provide serialization for storing data in the database as a byte array. The advanced concepts tutorial shows an example of how to read from the binary data, but not how to write to the database. Let's say I want to store a sensor_msgs::PointCloud2 or a pcl::Pointcloud to the database. How would I read/write it?
I currently have a database set up in postgres that's ready to accept the binary info as bytea data. In the database interface classes, I have:
database_interface::DBField< std::vector< char > > viewpoint_1_;
and in the constructor I have:
viewpoint_1_(database_interface::DBFieldBase::BINARY,
this, "viewpoint_1", "viewpoint", true)
I think this is set up properly, but I don't know how to get the data in and out of the database. Can anyone point me in the right direction?