I have been trying to publish a PointCloud2 message directly from a plugin, but I get this error when starting V-REP:
As for what I understand from the output of ldd, all my libraries are being loaded. After some trials, I found out that the problem was the line in which I published the message to ROS.load failed (could not load). The plugin probably couldn't load dependency libraries. Try 'ldd pluginName.so' for more infos, or simply rebuild the plugin
To make sure it wasn't a problem of my project, I used the "skeleton" plugin as a template and I wrote a simple example to force the same error. This time I was trying to publish just a std_msg::Float32 message and I got the same result.
I just added the libraries:
Code: Select all
#include <ros/ros.h>
#include <std_msgs/Float32.h>
and edited the LUA_GETDATA_CALLBACK function to publish the data:
Code: Select all
ros::NodeHandle n;
ros::Publisher pub;
pub = n.advertise<std_msgs::Float32>("/exampleTopic",1);
std_msgs::Float32 output;
output.data = 1123; //just a random number
pub.publish (output); //this line makes the plugin to crash
I leave a link the whole skeleton plugin showing the issue: https://www.dropbox.com/s/4fha13x7xgopw ... ar.gz?dl=0
Regards