float64 and eigen
Hi, I have a subsriber node that reads IMU measurements. For computational reasons I have to write the geometry_msgs/Vector3 angular_velocity into an eigen-library vector, any suggestions?
this is the code:
VectorXd imuData;
imuData(0) = msg->angular_velocity.x;
this is the error I get:
dede@ubuntu:~$ rosrun labrob_project my_subscriber
(view:3495): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
(view:3495): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
(view:3495): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
(view:3495): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
my_subscriber: /usr/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h:407: Eigen::DenseCoeffsBase<Derived, 1>::Scalar& Eigen::DenseCoeffsBase<Derived, 1>::operator()(Eigen::DenseCoeffsBase<Derived, 1>::Index) [with Derived = Eigen::Matrix<double, -0x00000000000000001, 1>, Eigen::DenseCoeffsBase<Derived, 1>::Scalar = double, Eigen::DenseCoeffsBase<Derived, 1>::Index = long int]: Assertion `index >= 0 && index < size()' failed.
Aborted
I don't really see what the problem is with that. Can you say why this should be problematic?
VectorXd imuData; imuData(0) = msg->angular_velocity.x; I have no problem in compiling this but at run time there's a typecast problem between float64 and double
float64 are doubles in ROS. This should work in principle. Please copy the exact error and the referred code in your post and have a look at the support guidelines: http://ros.org/wiki/Support.