Ask Your Question

Float64[9] covariance array in C++

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

Chrizzl gravatar image

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

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 -0500

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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 1,202 times

Last updated: Oct 05 '17