ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Tue, 29 Nov 2016 17:30:09 -0600A problem about the conversion from Euler angle to quaternionhttps://answers.ros.org/question/249058/a-problem-about-the-conversion-from-euler-angle-to-quaternion/Hi, all. we are trying to construct a 3D scanning system to implement 3D mapping algorithm. Its hardware system is showed in following figure : ![image description](/upfiles/14804590479821701.png).
A Hokuyo laser(UTM-30LX) is mounted on a plate which is rotated by a Dynamixel([MX-28R](http://support.robotis.com/beta/en/product/dynamixel/mx_series/mx-28.htm)). The Dynamixel works in back_and_ forth way. Its rotation angles' range is between -1.57 and 1.57, i.e. [-90° 90°] .
The tf tree is showed in following figure : ![image description](/upfiles/14804597194694478.png).
The frame_id "Laser" is the local scanning coordinate of Hokuyo laser. The frame_id "HN07_N101" is the local rotating(in back_and_forth way) coordinate of MX-28R. The frame_id "BaseLink" is the base_link coordinate of the system. The joint between "Laser" and "HN07_N101" is fixed. But there is a revolute joint between "HN07_N101" and "BaseLink".
The frame “HN07_N101” is rotated around its own "z" axis which is the blue axis in above figure. In the coordinate of "BaseLink", the origin of "HN07_N101" is (0.22375, 0, 0.1367), the initial orientation is (0.5, 0.5, 0.5, 0.5), as the left part of above figure shows.
As the Dynamixel rotating the Hokuyo laser, it is necessary to compute the coordinate transform between parent frame "BaseLink" and child frame "HN07_N101". The dynamixel motor sends [JointState](https://github.com/arebgun/dynamixel_motor/blob/master/dynamixel_msgs/msg/JointState.msg) message which contain the current rotating angle around "Z" axis in radians.
However, when I run my project, the transform between pararent "BaseLink" and "HN07_N101" is ***
**not smooth.**
***. Although there is no jump in the value of Dynamixel's msg, both the frame "HN07_N101"(including its child frame "Laser") and the 3D models of Hokuyo and Dynamixel alway flicking. The so called "flicking" is, while the frame "HN07_N101" is rotating, the green "y" axis and the red "x" axis suddenly switch positions with each other and recover.
I think the flicking 3D models displayed in rviz means that there is problem in the transfrom between "BaseLink" and "HN07_N101". But I don't know where the problem is.
Is the problem at the conversion from Euler angle (the current_pos in Dynamixel's msg) to the quaternion ( the variable "q" in above code) ?
Looking forwards any valuable advices. Thank you very much!scopusTue, 29 Nov 2016 17:30:09 -0600https://answers.ros.org/question/249058/how to find the 3d location of a given pixel (fixed monocular camera)https://answers.ros.org/question/171286/how-to-find-the-3d-location-of-a-given-pixel-fixed-monocular-camera/Given that I have the following:
- known pixels from an undistorted image (taken by monocular camera)
- fixed angle of inclination of camera
- fixed height of camera and flat terrain (so the height from camera to ground is fixed)
- intrinsic parameters of the camera (published over /camera_info), and also field-of-view angle
How can I find the 3-d (well, 2-d really since height is fixed) location (in the real world relative to the camera) of each pixel? i.e. what ROS packages/nodes should I use that have that functionality? I've been searching for a solution within ROS for weeks (and I'm surprised that no one has needed this before).
I attempted my own solution using some trigonometry, but it doesn't seem to work well (my equations must be off).
Is something like [projectPixelTo3dRay](http://docs.ros.org/api/image_geometry/html/python/#image_geometry.PinholeCameraModel.projectPixelTo3dRay) in image_geometry what I'm looking for?
Perhaps I simply don't know WHAT to look for when I'm searching... Can anyone point me in the right direction? I can't seem to figure this out on my own...
basheersubeiWed, 28 May 2014 14:46:28 -0500https://answers.ros.org/question/171286/