PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.21k stars 13.38k forks source link

Issue with the Pixhawk 6c's IMU #20633

Open EhrazImam opened 1 year ago

EhrazImam commented 1 year ago

Issue details

Hi i am using Pixhawk 6C with px4(1.13.1/1.13.2) and Cube Orange Plus with px4(1.14.0 Beta) When I’m changing the Pixhawk parameters in QGC (SYS_MC_EST_GROUP = No position, SYS_HAS_BARO & SYS_HAS_MAG = 0), it's only displays /mavros/imu/data_raw not /mavros/imu/data. With same parameter I have also tried on Pixhawk 4, Cube Orange and Cube Black with different firmware(1.11.0, 1.11.1, 1.12.0, 1.13.0, 1.13.1) and they all displaying /mavros/imu/data and /mavros/imu/data_raw as well.

MAVROS version and platform

Mavros: 1.14.0 ROS: Noetic Ubuntu: 20.04 Autopilot type and version

[ ] ArduPilot [ x ] PX4

afwilkin commented 1 year ago

/mavros/imu/data_raw not /mavros/imu/data_raw.

aren't these the same thing?

EhrazImam commented 1 year ago

@afwilkin Thankyou it was a typing error

EhrazImam commented 1 year ago

@bresch @julianoes Please help me with this

afwilkin commented 1 year ago

@EhrazImam the best way to get help is not through spamming the creators of PX4.

The first question is why do you need that specific topic? What are you trying to accomplish

EhrazImam commented 1 year ago

@afwilkin Sorry will keep it in mind.

  1. In my onboard control i am using nh.subscribe("/mavros/imu/data", why mavros/imu/data because i am using the orientation of IMU u.q = imu.q odom.q.inverse() q; when i am changing parameters i am no longer to give IMU's Orinetation because it is just publishing mavros/imu/data_raw.
  2. Why i am changing the parameter because i need to test it in high magnetic environment where i need to turn it off and while changing this parameter and PID it was working smooth as compared to SYS_MC_EST_GROUP=ekf2 (recommended), SYS_HAS_BARO & SYS_HAS_MAG = 1).
  3. And for localization i am using VIO.
afwilkin commented 1 year ago

I am still unsure on exactly what you are trying to accomplish, but it appears you are trying to get magnetometer data in highly disruptive environments is that correct?

Also, if you are flying over vio why do you need your magnetometer?

EhrazImam commented 1 year ago

Eigen::Quaterniond q = Eigen::AngleAxisd(des.yaw,Eigen::Vector3d::UnitZ())

I can make it fly without changing the parameters but i want to make work in High magnetic field for that i need to turn off the magnetometer. Yes, magnetometer data in highly disruptive in high magnetic environment.

afwilkin commented 1 year ago

I guess my question is, if you are flying over VIO, why do you need the magnetometer?

EhrazImam commented 1 year ago

The VIO pose is computed relative to the world frame where the x-axis points to the forward direction when we start VIO. However, the PX4 FCU update orientation is based on its own world frame. These two world frames are not aligned, especially in the yaw direction. So we have to subscribe the mavros/imu/data to acquire the yaw difference between the world frames of VIO and the FCU, so that we can convert the quaternion command computed in the VIO world frame to the FCU world frame.

bzw-uestc commented 9 months ago

I encountered the same problem, has this problem been solved?