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

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

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 image Chrizzl  ( 2017-10-05 05:28:14 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 1,988 times

Last updated: Oct 05 '17