Skip to content

Commit 2159a50

Browse files
committed
initial commit
1 parent 2c7eb97 commit 2159a50

Some content is hidden

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

43 files changed

+3085
-81
lines changed

.github/workflows/mkdocs_deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build Documentation using MkDocs
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the master branch
5+
on:
6+
push:
7+
branches: [deploy]
8+
pull_request:
9+
branches: [deploy]
10+
11+
jobs:
12+
build:
13+
name: Build and Deploy Documentation
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Master
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.x'
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install mkdocs-material
28+
29+
- name: Deploy
30+
run: |
31+
git pull
32+
mkdocs gh-deploy --strict

README.md

Lines changed: 16 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,28 @@
1-
# rmagine_docs
1+
# rmagine
22

3+
These docs are built with [MkDocs](https://mkdocs.org) and published to [uos.github.io/rmagine_ros](https://uos.github.io/rmagine_ros)
34

4-
5-
## Getting started
6-
7-
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
8-
9-
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
10-
11-
## Add your files
12-
13-
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14-
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
5+
## Build locally
156

167
```
17-
cd existing_repo
18-
git remote add origin https://gitlab.informatik.uni-osnabrueck.de/amock/rmagine_docs.git
19-
git branch -M main
20-
git push -uf origin main
8+
sudo apt install python3-pip
9+
pip3 install mkdocs mkdocs-material
2110
```
2211

23-
## Integrate with your tools
24-
25-
- [ ] [Set up project integrations](https://gitlab.informatik.uni-osnabrueck.de/amock/rmagine_docs/-/settings/integrations)
26-
27-
## Collaborate with your team
28-
29-
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30-
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31-
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32-
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33-
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
34-
35-
## Test and Deploy
36-
37-
Use the built-in continuous integration in GitLab.
38-
39-
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
40-
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41-
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42-
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43-
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
44-
45-
***
46-
47-
# Editing this README
48-
49-
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
12+
*Note: you may need to adapt your path `export PATH=$PATH:/home/<USER>/.local/bin` to access mkdocs binary*
5013

51-
## Suggestions for a good README
14+
### Build Static Files
5215

53-
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
54-
55-
## Name
56-
Choose a self-explaining name for your project.
57-
58-
## Description
59-
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
60-
61-
## Badges
62-
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
63-
64-
## Visuals
65-
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
66-
67-
## Installation
68-
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
69-
70-
## Usage
71-
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
72-
73-
## Support
74-
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
75-
76-
## Roadmap
77-
If you have ideas for releases in the future, it is a good idea to list them in the README.
78-
79-
## Contributing
80-
State if you are open to contributions and what your requirements are for accepting them.
81-
82-
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
16+
```
17+
mkdocs build --strict
18+
```
8319

84-
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
20+
### Live reloading server on :8000
8521

86-
## Authors and acknowledgment
87-
Show your appreciation to those who have contributed to the project.
22+
```
23+
mkdocs serve --strict
24+
```
8825

89-
## License
90-
For open source projects, say how it is licensed.
26+
## Deploy to naturerobots.github.io/mbf_docs
9127

92-
## Project status
93-
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
28+
Anything pushed to branch `deploy` will trigger a Github Action that builds the website and updates [naturerobots.github.io/mbf_docs](https://naturerobots.github.io/mbf_docs)

docs/extra/blender.md

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Work with Blender
2+
3+
Blender is a powerful tool to create and modify existing maps for rmagine.
4+
5+
Some Links to look up:
6+
- Webpage: https://www.blender.org/
7+
- Docs: https://docs.blender.org/manual/en/latest/
8+
9+
## Useful commands
10+
11+
### Object Mode
12+
13+
| Command | Effect | C |
14+
|:--------:|:----------:|:----:|
15+
| Ctrl + G | Move Object | after: type X and "0.5" to move the object 0.5 along the X axis |
16+
| Ctrl + R | Rotate Object | after: type Z and "45" to rotate the object 45 degree around the X axis |
17+
| Ctrl + S | Scale Object | after: type X and "2.0" to scale the object 2.0 along the X axis |
18+
19+
20+
21+
## Collada (DAE) exports (odyssey of wrong imports)
22+
23+
### UPDATE
24+
Blender plugin does everything right, Assimp writes the wrong transformation: See last sentence.
25+
26+
27+
### Beginning
28+
Some strange errors happened while exporting blender's scene to collada format. I did the following in Blender (3.2.1):
29+
30+
- Moved the Cube 5 units along the x axis
31+
- Moved the Cube 2 units along the y axis
32+
- Moved the Cube 3 units along the z axis
33+
- Rotated the Cube 45 degrees around the z axis
34+
- Scaled the Cube with 0.2 (the resulting cube has the dimensions 0.4 x 0.4 x 0.4)
35+
- Export DAE with default settings to "~/utitled.dae"
36+
37+
After some library fixes to read the scene graph completely, any collada file generated by Blender no longer loads correctly.
38+
With PLY exports, everything works as before.
39+
So I inspected the generated outputs of the Blender Collada exports (read by Assimp):
40+
41+
42+
```bash
43+
$:~ ./bin/rmagine_map_info ~/untitled.dae
44+
#...
45+
Scene Graph:
46+
- name: Scene
47+
- transform:
48+
M4x4[
49+
1 0 0 0
50+
0 0 1 0
51+
0 -1 0 0
52+
0 0 0 1
53+
]
54+
- meshes: 0
55+
- children: 3
56+
#...
57+
Node 2
58+
- name: Cube
59+
- transform:
60+
M4x4[
61+
0.141421 -0.141421 0 5
62+
0.141421 0.141421 0 2
63+
0 0 0.2 3
64+
0 0 0 1
65+
]
66+
- meshes: 1
67+
- mesh ref 0 -> 0
68+
- children: 0
69+
```
70+
71+
And exactly there is the problem. I guess the "Cube" transformation is correct since it come from Blender directly.
72+
The problem comes from the global matrix at node named "Scene".
73+
This matrix switches the y and z axes and negates the z axis (old y axis) afterwards.
74+
The complete transform of the "Cube" following the transformations to the root is
75+
76+
```v[5,3,-2], E[-1.5708, 0.785398, -1.26441e-07] with scale v[0.2,0.2,0.2]```
77+
78+
as expected, the total transform holds the axis-switched version of our previously done operations.
79+
But that is not what we want.
80+
Moving something in Blender along the x axis should result in an export with something in it that was moved along the x axis and no other axis.
81+
So how to fix it?
82+
Pushing `Export -> Colloda` opens a menu.
83+
Push the settings button in the top left corner.
84+
It opens a side panel, holding some values to change for the export.
85+
My first intuitive choice to set the forward axis to X and the up axis to Z were wrong, incomprehensibly.
86+
However, by trial and error I came up with setting these values as follows:
87+
88+
```
89+
Forward Axis: Z
90+
Up Axis: -Y
91+
```
92+
93+
With these settings the scene is exported exactly as I modelled it.
94+
Nevertheless, Blender exports the weird axis flip matrix at scene root.
95+
Every other transformation is adjusted such that every total transformation are valid.
96+
97+
```v[5,2,3], E[0, 0, 0.785398] with scale v[0.2,0.2,0.2]```
98+
99+
### Not yet fixed
100+
Importing this exported file into Blender results in a different scene.
101+
It seems the Blender Collada Importer ignores the top level axis-switch matrix somehow?
102+
FBX export and import is correct using the axis switch by choice.
103+
104+
105+
### FIXED
106+
The wrong up most transformation is written by Assimp!
107+
108+
- Assimp::Importer io; io.SetPropertyBool(AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION, true)
109+
110+
Capsuled in `AssimpIO`-Object ("rmagine/map/AssimpIO.hpp").
111+
112+
The following code snipped already corrects the wrong transformation imports.
113+
114+
```cpp
115+
rm::AssimpIO io;
116+
const aiScene* scene = io.ReadFile("file.dae", 0);
117+
```
118+
119+
With that, it is possible to default export Collada files with Blender, import them with rmagine and import them in Blender again, without any errors.
120+
121+
## Filmbox (FBX) exports
122+
123+
Same problems as in DAE section. Set axis to:
124+
125+
```
126+
Scale: 0.01
127+
Forward: Y Forward
128+
Up: Z Up
129+
```
130+
131+
Then everything is exported as modelled. Imports into Blender again are working as well.
132+
Luckilly, the global scene transform is set to identity here.
133+
Maybe that is why the Import is working again: ignoring the scene transform is not important if its an identity transform.
134+
135+
TODO: check if Gazebo importer ignores the scene transform
136+
137+
138+
## Building a 3D map from 2D building plan
139+
140+
Using Blender Version 3.3.1
141+
142+
### Setting up a 2D Map as Reference image
143+
144+
Make sure to be in Object Mode
145+
146+
1. Click top right on the z-axis to make the view orthograhic top down
147+
2. In Scene press Shift+A to open the Add Panel. Then select your Image and Load it into scene. The Image should now be located on your xy-plane
148+
3. Scale the Image to a size where you think you can work good with. The exact scale can be determined later.
149+
4. Enable Opacity of Image: Select Image and go to "Object Data Properties" (bottom right). Checkmark the Opacity Button
150+
151+
### Modelling
152+
153+
To place single vertices in the scene we first have to enable an Add-On under `Edit -> Preferences` called `Add Mesh: Extra Objects`.
154+
Then with Shift+A under the entry `Mesh` the option `Single Vert` should be available.
155+
Selecting `Single Vert` will place a single vertex in the origin and change to `Edit Mode`.
156+
A object should appear in the `Scene Collection` panel top right called `Vert`.
157+
158+
1. Move the image so that the first vertex to set is in the origin
159+
2. Insert a single vertex. A new object should be created. The first vertex is placed in the Origin.
160+
3. Press `E` to extrude a vertex than click an endpoint to place the second vertex with an edge connecting both.
161+
4. Contour: By again pressing `E` you can create a path of vertices. I recommend to make a complete path along the contour of the building plan (without doors. Only walls).
162+
5. Walls: Once you have created a contour of edges go to `Edge Select`-Mode select everything. Press `E`and then `Z` to extrude the edges along the z-axis. Pull the walls to a arbitrary height (The exact scale is determined later).
163+
6. Ground Faces: Go to `Vertex Select`-Mode and select three ground Vertices you want to connect (Hold Shift). Press `F` to connect them to a Face.
164+
- If Faces are getting to long: Cut Wall-Face in two by selecting in in `Face Select` Mode and then pressing Ctrl+R
165+
- Enable Statistics in Drop-Down Menu "Overlays" top right. If you notice during editing that there is more than one Vertex at one point: Select both of them in `Vertex Select`-Mode. The Right-Click and `Merge Vertices - Collapse`.
166+
167+
168+
169+
170+
171+
172+
173+
174+
175+

0 commit comments

Comments
 (0)