RoboMaster / RoboRTS

An open source software stack for Real-Time Strategy research on mobile robots
Other
826 stars 347 forks source link

Angle calculating #8

Closed HuskyRye closed 6 years ago

HuskyRye commented 6 years ago

The camera coordinate isn't always parallel to the world coordinate so you need to add the Euler angles. To compute the Euler angles, rotation vector must be turned into a rotation matrix using cv::Rodrigues().

See here: https://github.com/LiuChenxuan/RoboVision/blob/master/RoboVision.cpp#L58

noah003 commented 6 years ago

Hi Chenxuan, thanks for your suggestion. I haven't tested your codes, but I think there is no need to use cv::Rodrigues() because the angle can be calculated just by translation vector, it's simpler and easy to understand, please test this codes in practice. Let me know if you have any other questions.

HuskyRye commented 6 years ago

According to my understanding, there is an angle between the camera coordinate and the world coordinate, as shown in the graph above, so I don't understand why the angle can be calculated just by the translation vector.

noah003 commented 6 years ago

Our goal is to find a shooting point and calculate the coordinates of this point in the camera coordinate system (more specifically, the gimbal coordinate system), other than calculating coordinate transformation between world and camera.