You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe it would be a nice feature if the IMU could be automatically set up to be in the ENU frame by doing the following to the acceleration, gyroscope, and magnetometer data as the ROS navigation stack requires IMUs to be in the ENU Frame,.
// set linear acceleration
msg->linear_acceleration.x = last_accel_x_;
msg->linear_acceleration.y = last_accel_y_;
msg->linear_acceleration.z = last_accel_z_;
// set angular velocities
msg->angular_velocity.x = last_gyro_x_;
msg->angular_velocity.y = last_gyro_y_;
msg->angular_velocity.z = last_gyro_z_;
imu_pub_->publish(std::move(msg));
// Fill out and publish magnetic message
mag_msg->header.frame_id = frame_id_;
mag_msg->header.stamp = ros_time;
mag_msg->magnetic_field.x = last_mag_x_;
mag_msg->magnetic_field.y = last_mag_y_;
mag_msg->magnetic_field.z = last_mag_z_;
to
// set linear acceleration
msg->linear_acceleration.x = last_accel_y_;
msg->linear_acceleration.y = last_accel_x_;
msg->linear_acceleration.z = - last_accel_z_;
// set angular velocities
msg->angular_velocity.x = last_gyro_y_;
msg->angular_velocity.y = last_gyro_x_;
msg->angular_velocity.z = - last_gyro_z_;
imu_pub_->publish(std::move(msg));
// Fill out and publish magnetic message
mag_msg->header.frame_id = frame_id_;
mag_msg->header.stamp = ros_time;
mag_msg->magnetic_field.x = last_mag_y_;
mag_msg->magnetic_field.y = last_mag_x_;
mag_msg->magnetic_field.z = - last_mag_z_;
The text was updated successfully, but these errors were encountered:
Thanks for the link @clalancette, I don't believe that's needed for the Phidget_spatial library though (sorry, I forgot to specifiy which library I was talking about). There is not quaternion published, I use the imu_filter_madgwick fo that. I've found a few links mentioning that this way works for the conversion. Here is one linked, mavlink/mavros#49
However, the link posted I believe is correct once the quaternion has been generated from the acc, gyro and mag values.
Closing this as resolved. As you stated, the phidgets spatial does not publish orientations (yet), so NED / ENU / ... doesn't apply here. Feel free to reopen if necessary!
The current IMU uses the NED frame.
I believe it would be a nice feature if the IMU could be automatically set up to be in the ENU frame by doing the following to the acceleration, gyroscope, and magnetometer data as the ROS navigation stack requires IMUs to be in the ENU Frame,.
// set linear acceleration msg->linear_acceleration.x = last_accel_x_; msg->linear_acceleration.y = last_accel_y_; msg->linear_acceleration.z = last_accel_z_; // set angular velocities msg->angular_velocity.x = last_gyro_x_; msg->angular_velocity.y = last_gyro_y_; msg->angular_velocity.z = last_gyro_z_; imu_pub_->publish(std::move(msg)); // Fill out and publish magnetic message mag_msg->header.frame_id = frame_id_; mag_msg->header.stamp = ros_time; mag_msg->magnetic_field.x = last_mag_x_; mag_msg->magnetic_field.y = last_mag_y_; mag_msg->magnetic_field.z = last_mag_z_;
to
// set linear acceleration msg->linear_acceleration.x = last_accel_y_; msg->linear_acceleration.y = last_accel_x_; msg->linear_acceleration.z = - last_accel_z_; // set angular velocities msg->angular_velocity.x = last_gyro_y_; msg->angular_velocity.y = last_gyro_x_; msg->angular_velocity.z = - last_gyro_z_; imu_pub_->publish(std::move(msg)); // Fill out and publish magnetic message mag_msg->header.frame_id = frame_id_; mag_msg->header.stamp = ros_time; mag_msg->magnetic_field.x = last_mag_y_; mag_msg->magnetic_field.y = last_mag_x_; mag_msg->magnetic_field.z = - last_mag_z_;
The text was updated successfully, but these errors were encountered: