Skip to content

Commit 6d7131d

Browse files
committed
PDS field test docs
1 parent de54be1 commit 6d7131d

File tree

67 files changed

+3588
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+3588
-0
lines changed

.gitlab-ci.yml

+34
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ image: ubuntu:22.04
1616

1717
stages: # List of stages for jobs, and their order of execution
1818
- build
19+
- deploy
1920

2021
vale-linting:
2122
image:
@@ -35,3 +36,36 @@ vale-linting:
3536
- vale --minAlertLevel error /builds/syntron/support/csr/o3r/documentation/.
3637

3738

39+
internal-pages:
40+
image: python:3.8-slim
41+
stage: build
42+
script:
43+
- pip install sphinx myst-parser
44+
- mkdir site && cd site
45+
- sphinx-quickstart
46+
-p PDS
47+
-a ifm-CSR
48+
-r []
49+
-l en
50+
--extensions 'myst_parser'
51+
--sep
52+
- echo "master_doc = 'index_pds'" >> source/conf.py
53+
- echo "myst_enable_extensions = ['colon_fence',]" >> source/conf.py
54+
- cp -r ../PDS/* source/.
55+
- sphinx-build source build
56+
after_script:
57+
- pwd
58+
- ls site
59+
- cp -r site/build public
60+
artifacts:
61+
paths:
62+
- public
63+
64+
65+
pages:
66+
stage: deploy
67+
script:
68+
- ls public
69+
artifacts:
70+
paths:
71+
- public
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
# Calibration values cheat sheet
3+
Below are provided the rotation values for cameras mounted vertically and horizontally, to be used as reference when calibrating the camera for testing.
4+
5+
## Camera mounted horizontally - Label on top
6+
```json
7+
{
8+
"rotX": 0,
9+
"rotY": 1.57,
10+
"rotZ": -1.57,
11+
"transX": 0,
12+
"transY": 0,
13+
"transZ": 0
14+
}
15+
```
16+
17+
## Camera mounted horizontally - Label at the bottom
18+
```json
19+
{
20+
"rotX": 0,
21+
"rotY": 1.57,
22+
"rotZ": 1.57,
23+
"transX": 0,
24+
"transY": 0,
25+
"transZ": 0
26+
}
27+
```
28+
29+
## Camera mounted vertically - Cables on top
30+
```json
31+
{
32+
"rotX": 0,
33+
"rotY": 1.57,
34+
"rotZ": 0,
35+
"transX": 0,
36+
"transY": 0,
37+
"transZ": 0
38+
}
39+
```
40+
41+
## Camera mounted vertically - Cables at the bottom
42+
```json
43+
{
44+
"rotX": 0,
45+
"rotY": 1.57,
46+
"rotZ": -3.142,
47+
"transX": 0,
48+
"transY": 0,
49+
"transZ": 0
50+
}
51+
```

PDS/Calibration/pds_calibration.md

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
nosearch: true
3+
---
4+
5+
# Camera calibration for PDS
6+
7+
The PDS application always returns the position of an object with respect to the calibrated coordinate system. Typically, the calibrated coordinate system corresponds to the fork tines, so that the coordinate system will go up and down with the forks and the pallet position will always be provided with reference to the current position of the forks.
8+
9+
## Concepts
10+
### PDS coordinate system
11+
PDS expects the orientation of the coordinate system to be as follows:
12+
- X is pointing in direction of the forks,
13+
- Y is pointing to the left of the forks,
14+
- Z is pointing up.
15+
16+
When uncalibrated, the camera coordinate system is such that Z is pointing away from the camera, and X is pointing away from the cables. This is represented in the image below:
17+
18+
![Uncalibrated camera coordinate system](resources/default_camera_coord_sys.png)
19+
20+
The uncalibrated coordinate system does not correspond to what PDS expects. Consequently, if no calibration is set, PDS will raise an error.
21+
22+
To fit the expected coordinate system of PDS, the coordinate system has to be rotated. An example of a correctly calibrated coordinate system would be as shown in the image below, where the origin of the coordinate system is placed at the center of the base of the forks:
23+
24+
![Coordinate system calibrated to the center of the base of the forks](resources/forks_base_center_coord_sys.png)
25+
26+
Note that the user can decide where to place the origin of the coordinate system. We show a couple of examples [below](#examples).
27+
28+
PDS will look for a pallet within a defined volume of interest. By default, it expects the camera to be placed at approximately the same level as the bottom plane of the pallet.
29+
For more details about the volume of interest for the different PDS commands, refer to their respective documentation.
30+
31+
Note that errors in the camera calibration will lead to errors in the position of the targeted object. If CAD data is known to be precise enough, it can be used to extract calibration values for the camera. Otherwise, any of [the calibration methods](../../CalibrationRoutines/index_calibrations.md) provided by ifm can be used.
32+
33+
### Robot Coordinate System
34+
PDS' coordinate system will most often be different from the Robot Coordinate System (RCS):
35+
- The RCS is usually in a fixed position on the robot's chassis, whereas PDS' coordinate systems moves with the forks. The transformation between the RCS and the PDS coordinate system will depend on the position of the forks and has to be implemented by the user.
36+
- The RCS is typically in the middle of the steering axis, whereas PDS' coordinate system is located around the forks base or tip.
37+
- In general, the axis of the RCS and the PDS coordinate systems will be parallel. The X axis of the RCS usually points in the direction of travel, and PDS' coordinate system X axis points in the direction of the forks, which would typically be towards the back of the vehicle. The Z axis will point upwards in both coordinate system.
38+
39+
:::{note}
40+
Note that these comments represent most typical use cases, but your coordinate system might be different. The coordinate system can be adjusted to fit your specific setup.
41+
:::
42+
43+
## Examples
44+
45+
### Tip of fork coordinate system
46+
Let's take for example a camera mounted horizontally, looking straight ahead, directly between the two forks.
47+
Let's assume the fork tines coordinate system's origin is at the tip of the right fork, like shown in the image below:
48+
![Coordinate system calibrated to the tip of the right fork](resources/forks_tips_coord_sys.png)
49+
50+
Let's also assume the following measurements:
51+
52+
![Translation values from the camera to the tip of the right fork](resources/translations_to_fork_tip.png)
53+
54+
Then, the values for the rotation and translations are as follows, shown in the Vision Assistant calibration wizard:
55+
56+
![Calibration values for the tip of fork example](resources/calibration_values_fork_tips.png)
57+
58+
This is equivalent to setting the following parameters in the relevant port's JSON configuration:
59+
```json
60+
{
61+
"ports":{
62+
"portX":{
63+
"processing":{
64+
"extrinsicHeadToUser":{
65+
{
66+
"rotX": 0.00,
67+
"rotY": 1.57,
68+
"rotZ": -1.57,
69+
"transX": 1.00,
70+
"transY": 0.25,
71+
"transZ": 0.05
72+
}
73+
}
74+
}
75+
}
76+
}
77+
}
78+
```
79+
80+
### Base of forks coordinate system
81+
82+
Let's take another example and assume the camera is mounted horizontally pointing forward, directly between the two forks, and the origin of the coordinate system is at the base of forks, right between the two forks, as shown in the image below:
83+
![Coordinate system calibrated to the center of the base of the forks](resources/forks_base_center_coord_sys_with_cam.png)
84+
85+
Let's assume that the center of the coordinate system is 5 cm below the camera, and on the same (YZ) plane:
86+
![Measurements between the camera and the coordinate system](resources/translation_to_forks_base_center.png)
87+
88+
With these measurements, we would have the following calibration values:
89+
![Calibration values with the coordinate system at the base of the forks](resources/calibration_values_fork_base.png)
90+
This is equivalent to setting the following parameters in the relevant port's JSON configuration:
91+
```json
92+
{
93+
"ports":{
94+
"portX":{
95+
"processing":{
96+
"extrinsicHeadToUser":{
97+
{
98+
"rotX": 0.00,
99+
"rotY": 1.57,
100+
"rotZ": -1.57,
101+
"transX": 0.00,
102+
"transY": 0.00,
103+
"transZ": 0.05
104+
}
105+
}
106+
}
107+
}
108+
}
109+
}
110+
```
119 KB
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
15 KB
Loading
Loading
Loading

PDS/Configuration/configuration.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
nosearch: true
3+
---
4+
5+
# Configuration
6+
7+
The PDS application is instantiated with a set of JSON parameters.
8+
A minimal instantiation is as follows, where `"app0"` can be replaced by another app index if required:
9+
10+
```json
11+
{
12+
"applications":{
13+
"instances":{
14+
"app0":{
15+
"class": "pds"
16+
}
17+
}
18+
}
19+
}
20+
```
21+
:::{note}
22+
The user can refer to the [JSON schema](../../Technology/configuration.md#json-schema) after instantiating the application for more details on the available parameters.
23+
:::
24+
25+
This is equivalent to creating a PDS app in the Vision Assistant:
26+
27+
![Instantiating a PDS app in the Vision Assistant](resources/instantiate_app.png)
28+
29+
![Instantiated app with default settings](resources/default_app.png)
30+
31+
The app will be instantiated with all parameters set to their default values.
32+
The parameters can be further configured and are described below.
33+
34+
35+
| Parameter | Description |
36+
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
37+
| `name` | Providing a custom name for the PDS application |
38+
| `ports` | The port that is used by the PDS application |
39+
| `state` | The current app state (default: `CONF`) |
40+
| `configuration/customization/command` | The command to be executed by PDS (`getPallet`, `getRack`, `getItem`, `volCheck` or `nop`). `nop` corresponds to no operation. After a command is executed by the PDS, the command parameter is set back to `nop` value. | |
41+
| `configuration/customization/getPallet` | Configure the `getPallet` command. Refer to [the `getPallet` documentation](../GetPallet/getPallet.md) for further details on the relevant parameters. |
42+
| `configuration/customization/getRack` | Configure the `getRack` command. Refer to [the `getRack` documentation](../GetRack/getRack.md) for further details on the relevant parameters. |
43+
| `configuration/customization/getItem` | Configure the `getItem` command. Refer to [the `getItem` documentation](../GetItem/getItem.md) for further details on the relevant parameters. |
44+
| `configuration/customization/volCheck` | Configure the `volCheck` command. Refer to [the `volCheck` documentation](../VolCheck/volCheck.md) for further details on the relevant parameters. |
45+
| `configuration/port/mode` | To designate the measurement range: 2 or 4 meters. This parameter is configurable only in `CONF` state. |
46+
| `configuration/port/acquisition/channelValue` | Channel value where each channel corresponding to a different modulation frequency. This parameter is configurable only in `CONF` state. |
47+
| `configuration/port/acquisition/exposureLong` | Parametrize the long exposure time. This parameter is configurable only in `CONF` state. The default value works for the majority of use cases and we do not recommend changing this value. |
48+
| `configuration/port/acquisition/exposureShort` | Parametrize the short exposure time. This parameter is configurable only in `CONF` state. The default value works for the majority of use cases and we do not recommend changing this value. |
49+
| `configuration/port/acquisition/offset` | Shifts the starting point of the measured range. This parameter is configurable only in `CONF` state. The default value works for the majority of use cases and we do not recommend changing this value. |
46.3 KB
Loading
49.8 KB
Loading

PDS/Cpp/CMakeLists.txt

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
cmake_minimum_required(VERSION 3.11)
2+
3+
project(o3r_examples CXX)
4+
5+
#Global compiler flags
6+
set(CMAKE_BUILD_TYPE Release) # Release or Debug
7+
set(CMAKE_CXX_EXTENSIONS OFF) # OFF -> -std=c++14, ON -> -std=gnu++14
8+
set(CMAKE_CXX_STANDARD 17)
9+
set(CMAKE_CXX_STANDARD_REQUIRED true)
10+
11+
#find ifm3d on the system
12+
find_package(ifm3d 1.5.3 CONFIG
13+
REQUIRED COMPONENTS device framegrabber deserialize
14+
)
15+
16+
## Volume check example
17+
add_executable(vol_check vol_check.cpp)
18+
target_link_libraries(vol_check
19+
ifm3d::device
20+
ifm3d::framegrabber
21+
)
22+
23+
## Get pallet example
24+
add_executable(get_pallet get_pallet.cpp)
25+
target_link_libraries(get_pallet
26+
ifm3d::device
27+
ifm3d::framegrabber
28+
)
29+
30+
## Get item example
31+
add_executable(get_item get_item.cpp)
32+
target_link_libraries(get_item
33+
ifm3d::device
34+
ifm3d::framegrabber
35+
)
36+
## Get rack example
37+
add_executable(get_rack get_rack.cpp)
38+
target_link_libraries(get_rack
39+
ifm3d::device
40+
ifm3d::framegrabber
41+
)
42+
## Get rack example
43+
add_executable(get_flags get_flags.cpp)
44+
target_link_libraries(get_flags
45+
ifm3d::device
46+
ifm3d::framegrabber
47+
)

0 commit comments

Comments
 (0)