Hi,
our team is actually almost totally new to ROS. So this question is rather a practical one.
I've read all the instructions at least twice, so if I missed something I'm sorry in advance.
The problem is simple - I don't know how to access the data given by simserv from the callback function.
The sample code is:
// ------------ Compute pose here ------------------
// ## Grab image and imu data and compute pose.
//req.vi_data.image[0];
// req.vi_data.image[1];
// req.vi_data.imu[0 ... n];
We want to work with the images in OpenCV. So I've used this tutorial to get the image.
http://wiki.ros.org/cv_bridge/Tutorials ... enCVImages
In every fifth serviceCallback() function I call
imageCb(( sensor_msgs::ImageConstPtr& ) req.vi_data.image[0]);
The ROS task crashes on this:
try
{
printf ( "B_here1\n" );
cv_ptr = cv_bridge::toCvCopy ( msg, sensor_msgs::image_encodings::BGR8 );
printf ( "B_here2\n" );
}
catch ( cv_bridge::Exception& e )
{
ROS_ERROR ( "cv_bridge exception: %s", e.what() );
return;
}
It doesn't get through toCvCopy.
The message I get in terminal is:
[euroc_solution_t1-1] process has died [pid 22178, exit code -11, cmd /home/simclient/catkin_ws/devel/lib/euroc_solution_t1/euroc_solution_t1 __name:=euroc_solution_t1 __log:=/home/simclient/.ros/log/76bdc194-29f7-11e4-9a92-08002749a783/euroc_solution_t1-1.log].
log file: /home/simclient/.ros/log/76bdc194-29f7-11e4-9a92-08002749a783/euroc_solution_t1-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
The log file does not help at all. There's no ROS_ERROR ( "cv_bridge exception: %s", e.what() ); message in the terminal output, so I don't even know the origin of the crash.
So the first question is - how to get the simserv data into standard cvMat format and how to debug the ROS crash?
Second question is - in what data type format are the imu data stored? What exactly is imu[0] imu[1]... etc. How to access them?
Again, I haven't found any details on the imu data in the instruction documents. Perhaps there is a standard way to do so which is clear to people used to ROS?
Since we're not, it is not clear to us.
Please point us to the right direction.