Skip to content

Commit a80a916

Browse files
committed
moved from endre90
0 parents  commit a80a916

28 files changed

+6940
-0
lines changed

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Scene Manipulation Service
2+
3+
This is the new and integrated scene manipulation service, that also offers a lookup service.
4+
5+
![Alt text](/description/sms_chart.png "")
6+
7+
### Documentation:
8+
9+
Pending
10+
11+
<!-- In the ROS2 world, the `tf` maintains the relationships between different coordinate frames in a tree structure buffered in time. One can include frames to that tree by `broadcasting` frame data to the `tf`. One can also `lookup` relationships between frames from this tree. Using the broadcasting and lookup tools, one can then use the `Scene Manipulation Service` to manipulate the scene in different ways.
12+
13+
To address a certain robotic or manufacturing setup, we use the notion of `scenarios`. A `scenario` is represented by its resources, their arrangement,and the task that they are going to execute. To initialize a scenario, the scenario folder contains a collection of frame description files in a `.json` format.
14+
15+
## Features
16+
1. Load initial frames from a scenario folder using `.json` description files while launching the service.
17+
2. Add, update, or remove scenario frames by manually adding or removing `.json` description files to or from the scenario folder. How does this work? The frames that are added throught the scenario folder have a `folder_loaded` tag that is meant to differentiate them from the frames added through the service call. If the frame was updated through the service, it is not `folder_loaded` anymore, and thus will not be removed from the current scene if manually removed from the folder.
18+
3. Add, update, or remove scenario frames using the service.
19+
20+
Let's look at an example scenario located in the bringup package `scenario_1`, where we want to initialize the scene with two frames. The descriptions of these two frames are:
21+
22+
```
23+
frame_1.json: frame_2.json:
24+
{ {
25+
"active": true, "active": false,
26+
"child_frame_id": "frame_1", "child_frame_id": "frame_2",
27+
"parent_frame_id": "world", "parent_frame_id": "frame_1",
28+
"transform": { "transform": {
29+
"translation": { "translation": {
30+
"x": 1.0, "x": 0.0,
31+
"y": 0.0, "y": 1.0,
32+
"z": 0.0 "z": 0.0
33+
}, },
34+
"rotation": { "rotation": {
35+
"x": 0.0, "x": 0.0,
36+
"y": 0.0, "y": 0.0,
37+
"z": 0.0, "z": 0.0,
38+
"w": 1.0 "w": 1.0
39+
} }
40+
} }
41+
} }
42+
```
43+
There are two main ways one can manipulate the scene:
44+
1. By manually adding or removing .json files from the scenario folder
45+
2. By requesting scene manipulations with a service call
46+
47+
## Buffer
48+
Since we are not doing any path planning, i.e. we don't need any frame interpolation in time to generate trajectories,
49+
the buffer that is maintained here is simpler than the buffer that one would use for motion planning. Contrary to keeping all incomming frames in the buffer
50+
for `DEFAULT_BUFFER_TIMESPAN` which is 10 seconds, the buffer is a simple hashmap which overwrites the previous value if a fresher one comes in.
51+
Let's take the two frames as an example. The buffer has two parameters: `ACTIVE_FRAME_LIFETIME` and `DEFAULT_BUFFER_TIMESPAN`.
52+
53+
## TODO: add to the flowchart that `exists?` must be checked with the new fast lookup in the future instead of the local hashmap in the broadcaster
54+
55+
## Test checklist:
56+
- [ ] service -> remove -> not_in_buffer -> not_in_bc -> FAULT
57+
- [ ] service -> remove -> not_in_buffer -> in_bc -> wait -> not_in_buffer -> FAULT
58+
- [ ] service -> remove -> not_in_buffer -> in_bc -> wait -> in_buffer -> static -> FAULT
59+
- [ ] service -> remove -> not_in_buffer -> in_bc -> wait -> in_buffer -> active -> folder_tag -> FAULT
60+
- [ ] service -> remove -> not_in_buffer -> in_bc -> wait -> in_buffer -> active -> not_folder_tag -> SUCCESS
61+
- [ ] service -> remove -> in_buffer -> not_in_bc -> FAULT
62+
- [ ] service -> remove -> in_buffer -> in_bc -> static -> FAULT
63+
- [ ] service -> remove -> in_buffer -> in_bc -> active -> folder_tag -> FAULT
64+
- [ ] service -> remove -> in_buffer -> in_bc -> active -> not_folder_tag -> SUCCESS
65+
66+
## Affine transformations
67+
An affine transformation is any transformation that preserves collinearity (i.e., all points lying on a line initially still lie on a line after transformation) and ratios of distances (e.g., the midpoint of a line segment remains the midpoint after transformation). In this sense, affine indicates a special class of projective transformations that do not move any objects from the affine space R^3 to the plane at infinity or conversely. An affine transformation is also called an affinity.
68+
69+
Geometric contraction, expansion, dilation, reflection, rotation, shear, similarity transformations, spiral similarities, and translation are all affine transformations, as are their combinations. In general, an affine transformation is a composition of rotations, translations, dilations, and shears.
70+
71+
While an affine transformation preserves proportions on lines, it does not necessarily preserve angles or lengths. Any triangle can be transformed into any other by an affine transformation, so all triangles are affine and, in this sense, affine is a generalization of congruent and similar. -->
72+
73+
### Acknowledgements:
74+
Christian Larsen - FCC

0 commit comments

Comments
 (0)