... | ... | @@ -12,42 +12,11 @@ CameraInfo Message: `/camera_info` |
|
|
|
|
|
Transform Message: `/image_vectors`
|
|
|
|
|
|
|
|
|
## TBD
|
|
|
|
|
|
|
|
|
Things to be done:
|
|
|
|
|
|
- [ ] Check camera coordinate system must be aligned with drone coordinate system ??
|
|
|
- [ ] Redo Camera Calibration file
|
|
|
- [ ] Clean up here and describe Input and Output
|
|
|
|
|
|
- [ ] Integrity: discuss, how tvec and rved are calculated in case of detecting multiple markers and find faulty ones --> So far take marker in the middle, else one of the other
|
|
|
|
|
|
|
|
|
# Image Processing Package Installation Requirements
|
|
|
|
|
|
```
|
|
|
sudo apt install python3-opencv
|
|
|
sudo apt install python3-scipy
|
|
|
```
|
|
|
|
|
|
More at
|
|
|
|
|
|
http://wiki.ros.org/vision_opencv
|
|
|
|
|
|
Basic Python example
|
|
|
|
|
|
https://answers.ros.org/question/321501/subscriber-python-camerainfo-and-image/
|
|
|
|
|
|
|
|
|
# Message
|
|
|
|
|
|
Read up more about predefined messages:
|
|
|
Read more about the transform message here:
|
|
|
|
|
|
https://github.com/ros2/common_interfaces/tree/master/geometry_msgs/msg
|
|
|
|
|
|
For using the topic "image_vectors" of image_vector_node:
|
|
|
For using the topic "image_vectors" of image_vector_node some sample code.
|
|
|
|
|
|
```
|
|
|
from geometry_msgs.msg import Transform
|
... | ... | @@ -55,6 +24,7 @@ from geometry_msgs.msg import Transform |
|
|
# Define Subscriber with Transform msg type
|
|
|
(...)
|
|
|
|
|
|
# Access Python translational Variable x message
|
|
|
msg.translational.x
|
|
|
|
|
|
# or
|
... | ... | @@ -64,24 +34,37 @@ msg.rotational.x |
|
|
# See link above for more details
|
|
|
```
|
|
|
|
|
|
# Image Processing Package Installation Requirements
|
|
|
|
|
|
These have to be installed manually. Maybe move these dependencies with rosdep? https://docs.ros.org/en/foxy/Guides/Using-Python-Packages.html
|
|
|
```
|
|
|
sudo apt install python3-opencv
|
|
|
sudo apt install python3-scipy
|
|
|
```
|
|
|
|
|
|
More about these opencv:
|
|
|
|
|
|
http://wiki.ros.org/vision_opencv
|
|
|
|
|
|
# Calculation
|
|
|
|
|
|
Here are some useful links for some calculation:
|
|
|
|
|
|
Function for Transformation of Rotation Vector into Quaternion that is used:
|
|
|
|
|
|
Transformation of Rotation Vector into Quaternion
|
|
|
https://docs.scipy.org/doc/scipy/reference/reference/generated/scipy.spatial.transform.Rotation.html
|
|
|
|
|
|
Main function in open cv to extract translation and rotation vector from:
|
|
|
Main function in open cv to extract translation and rotation vector from found aruco markers read here:
|
|
|
|
|
|
https://docs.opencv.org/master/d9/d6a/group__aruco.html#ga84dd2e88f3e8c3255eb78e0f79571bd1
|
|
|
|
|
|
Camera Coordinate System:
|
|
|
|
|
|
https://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/OWENS/LECT9/node2.html
|
|
|
|
|
|
|
|
|
# Camera Calibration
|
|
|
|
|
|
- [ ] Maybe move to RasPy Camera?
|
|
|
|
|
|
|
|
|
Run through the following example (with one exception below):
|
|
|
https://navigation.ros.org/tutorials/docs/camera_calibration.html
|
|
|
|
... | ... | @@ -96,4 +79,4 @@ This calibration procedure lead to the calibration file example_calibration.yaml |
|
|
|
|
|
https://github.com/UbiquityRobotics/raspicam_node/blob/kinetic/camera_info/camerav2_1280x960.yaml --> Corresponds to example_calibration2.yml (If someone want to try out).
|
|
|
|
|
|
Rename the default camera calibration file path if wanted in camera_info_manager.cpp of the image_common package |
|
|
\ No newline at end of file |
|
|
Rename the default camera calibration file path if wanted in camera_info_manager.cpp of the image_common package. |
|
|
\ No newline at end of file |