Ask Your Question
0

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: http://docs.ros.org/api/sensor_msgs/h...

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
1

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

Comments

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 imageChrizzl ( 2017-10-05 05:28:14 -0600 )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

Stats

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

Seen: 747 times

Last updated: Oct 05 '17