Install error:odom.cpp:235:50: error: ‘struct mavlink::common::msg::ODOMETRY’ has no member named ‘twist_covariance’

Hello
under ubuntu 16.04

   `source ubuntu_sim_ros_gazebo.sh`

got error:
Starting >>> mavros
Finished <<< mavros [ 0.9 seconds ]
Starting >>> mavros_extras
_____________________________________________________________________________________________________________________________________________________________________
Errors << mavros_extras:make /home/x-man/catkin_ws/logs/mavros_extras/build.make.001.log
/home/x-man/catkin_ws/src/mavros/mavros_extras/src/plugins/odom.cpp: In member function ‘void mavros::extra_plugins::OdometryPlugin::handle_odom(const mavlink_message_t*, mavlink::common::msg::ODOMETRY&)’:
/home/x-man/catkin_ws/src/mavros/mavros_extras/src/plugins/odom.cpp:235:50: error: ‘struct mavlink::common::msg::ODOMETRY’ has no member named ‘twist_covariance’
ftf::mavlink_urt_to_covariance_matrix(odom_msg.twist_covariance, cov_vel);
^
/home/x-man/catkin_ws/src/mavros/mavros_extras/src/plugins/odom.cpp: In member function ‘void mavros::extra_plugins::OdometryPlugin::odom_cb(const ConstPtr&)’:
/home/x-man/catkin_ws/src/mavros/mavros_extras/src/plugins/odom.cpp:411:51: error: ‘struct mavlink::common::msg::ODOMETRY’ has no member named ‘twist_covariance’
ftf::covariance_urt_to_mavlink(cov_vel_map, msg.twist_covariance);

would you please tell me how to fix this issue?

1 Like

what i did is in the odom.cpp file that is available in catkin_ws/src/mavros/mavros_extras/src/plugins/ i change the twist_covariance to velocity_covariance

so the line 235 became : ftf::mavlink_urt_to_covariance_matrix(odom_msg.velocity_covariance, cov_vel);

as well as line 411 became :
ftf::covariance_urt_to_mavlink(cov_vel_map, msg.velocity_covariance);

And it compiled very fine.

3 Likes