Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I get quaternions from RealSense 515 #2241

Closed
xyxegle opened this issue Feb 4, 2022 · 19 comments
Closed

How can I get quaternions from RealSense 515 #2241

xyxegle opened this issue Feb 4, 2022 · 19 comments
Labels

Comments

@xyxegle
Copy link

xyxegle commented Feb 4, 2022

Required Info  
Camera Model L515
ROS version Melodic
Firmware Version Running with LibRealSense v2.49.0 FW version: 01.05.08.01
Operating System & Version Ubuntu18.04
Kernel Version (Linux Only) 5.4.0-89-generic
Platform PC
Language C++/Python
Serial No. f1062522
Product ID 0B64

I'm going to do an experiment that uses quaternions. I have enabled enable_gyro and enable_accel in the launch file and assigned unite_IMu_method to "copy". Now I have successfully obtained the /camera/ IMU topic, but when I subscribed to the topic, I found that the orientation part of the topic was null, may I ask if I have the wrong configuration there?

This is the topic content THAT I got, and you can see that the orientation section is always empty
image

This is the modified content in my launch file. Line 52 is assigned "copy" in addition lines 35 and 36 is assigned to "true".

image

@xyxegle
Copy link
Author

xyxegle commented Feb 4, 2022

I have also assigned 'Unite IMu method' to Linear Interpolation,for further test.What really bothers me is that linee_acceleration's parameters get worse and worse as time goes by.
image
Do you have any suggestions?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Feb 4, 2022

Hi @xyxegle In #1449 (comment) Doronhi the RealSense ROS wrapper developer suggests displaying the rotation quaternions (regarding the transform between gyro and depth) using the command below:

rosrun tf tf_echo camera_depth_optical_frame camera_gyro_optical_frame

In regard to the linear interpolation mode, Copy should provide greater stability of values.

@xyxegle
Copy link
Author

xyxegle commented Feb 4, 2022

image
It looks like there's something wrong

@MartyG-RealSense
Copy link
Collaborator

If you are referring to the messages about the IMU not being calibrated and the frame time domain being HARDWARE_CLOCK, this should not affect the retrieval of quaternions as far as I am aware.

@xyxegle
Copy link
Author

xyxegle commented Feb 4, 2022

However, I did not receive any information about quaternion as you said.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Feb 4, 2022

Did you try an echo command of the gyro with a rosrun instruction after launch has completed, as suggested above in #2241 (comment) please?

@xyxegle
Copy link
Author

xyxegle commented Feb 4, 2022

Yes, I tried the method you said, but it doesn't seem to work, the upper left corner of the previous answer is the result of running the command

@MartyG-RealSense
Copy link
Collaborator

Given that you are using unite_imu_method to publish the IMU as a single 'imu' topic instead of separate gyro and accel topics, does the echo work if you do it like this:

rosrun tf tf_echo camera_depth_optical_frame camera_imu_optical_frame

@xyxegle
Copy link
Author

xyxegle commented Feb 4, 2022

image
It does show some data, but the data doesn't look normal. It only displays data at time 0.000, but does not update over time. Also, I wonder if there is any way to integrate it into the launch file.

@MartyG-RealSense
Copy link
Collaborator

There is a discussion at #2097 about 0.000 time when performing a tf echo.

I do not personally know of a method for activating a rosrun tf echo from within a launch file, since rosrun is a process that is performed after launch is completed.

@xyxegle
Copy link
Author

xyxegle commented Feb 4, 2022

After several experiments, I think the solution you give should not be the camera quaternion information. I think it's more like relative position information inside the sensor. I changed the position, direction and Angle of the sensor, but I got the same data after every restart, which I think is abnormal. Do you have any other solutions?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Feb 4, 2022

The extrinsic transforms describe the fixed position and rotation relationship between two sensors. What would update in real-time when a camera that is equipped with an IMU is rotated is the gyro xyz angles (roll, pitch, yaw). and the movement speed of the camera (its accel)

@xyxegle
Copy link
Author

xyxegle commented Feb 4, 2022

So how do I get the Euler Angle of the IMU output?

The 'unite IMU method' provides both linear and angular velocities. But how do I get euler angles(roll\pitch\yaw)?

@xyxegle
Copy link
Author

xyxegle commented Feb 4, 2022

image

image

As you can see, this is gyro and Accel output separately. There is no euler Angle content. How can I get it?

@xyxegle
Copy link
Author

xyxegle commented Feb 4, 2022

image

@MartyG-RealSense
Copy link
Collaborator

In #1932 (comment) a RealSense ROS user also obtained the IMU quaternions using a ROS package called imu_tools

@MartyG-RealSense
Copy link
Collaborator

Hi @xyxegle Do you require further assistance with this case, please? Thanks!

@xyxegle
Copy link
Author

xyxegle commented Feb 10, 2022

Thank you very much. I have solved the problem.I have created a new problem, could you help me to solve it?Here's a link to that question:#2250

@MartyG-RealSense
Copy link
Collaborator

It's excellent to hear that you found a solution for your quaterions issue, and I have replied at your other question. I will now close this quaternion issue. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants