ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Float64[9] covariance array in C++

asked 2017-10-05 03:39:35 -0600

Chrizzl gravatar image

updated 2017-10-05 03:40:34 -0600

I am trying to fill in an IMU message, and it requires 3 arrays of Float64's. How can I fill such an array in C++, initializing the first element with value -1 and the other values 0.

The documentation of the message can be found here:

I know the C++ double type should be the same as ROS Float64. This doesn't help me much unfortunately, I can't find any way to correctly initialize this array.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-10-05 04:02:56 -0600

Here's an example of values of the IMU message covariance array being filled: UM7 driver main.cpp. I think this example should clarify it nicely.

edit flag offensive delete link more


Thank you, the line you linked to was the solution! For completeness that line is below:

imu_msg.linear_acceleration_covariance[0] = -1.0;
Chrizzl gravatar image Chrizzl  ( 2017-10-05 05:28:14 -0600 )edit

Question Tools

1 follower


Asked: 2017-10-05 03:39:35 -0600

Seen: 1,930 times

Last updated: Oct 05 '17