Skip to content

Commit 187df0f

Browse files
MaxWaterhoutMax WaterhoutJelmerdw
authored
Added extra documentation (#187)
* Added extra documentation --------- Signed-off-by: Max Waterhout <max.waterhout@soprasteria.com> Signed-off-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com> Signed-off-by: Max Waterhout <max.waterhout@hotmail.nl> Co-authored-by: Max Waterhout <max.waterhout@soprasteria.com> Co-authored-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com>
1 parent ecd066f commit 187df0f

13 files changed

Lines changed: 186 additions & 133 deletions

File tree

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ SPDX-FileCopyrightText: Alliander N. V.
44
SPDX-License-Identifier: Apache-2.0
55
-->
66

7-
# ros_package conventions
7+
# Conventions
88

9-
## Folder Structure
9+
## ROS packages
10+
11+
ROS packages are defined in the *ros2_ws/src* directory.
12+
13+
### Folder Structure
1014

1115
We try to follow this folder structure for the ROS packages:
1216

@@ -28,7 +32,14 @@ ros_package/
2832
└───ros_package/
2933
| | __init__.py
3034
| | py_module.py
31-
|
35+
│ └── test/
36+
│ ├── conftest.py
37+
│ ├── unit/
38+
│ │ └── test_py_module.py
39+
│ ├── integration/
40+
│ │ └── test_service_client.py
41+
│ └── end_to_end/
42+
│ └── test_full_launch.py
3243
└───launch/
3344
| launch_file.launch.py
3445
```
@@ -39,8 +50,15 @@ ros_package/
3950
- A sub-directory `ros_package/` with the same name as the ROS package can be used to create a Python package. This directory contains an `__init__.py` file and the Python modules of the Python package.
4051
- Possible launch files are located in the `launch/` directory.
4152
- More directories are possible, like `urdf/` for urdf files or `config/` for config files.
53+
- The testing layout is placed alongside the Python package, with these subfolders:
4254

43-
## CMakeLists.txt
55+
- `unit/` for fast, logic-only tests
56+
- `integration/` for multi-component or ROS client/server tests
57+
- `end_to_end/` for full launch/simulation tests
58+
59+
Use a top-level `test/conftest.py` to define shared fixtures, and name your files/functions `test_*` so pytest auto-discovers them. The most general fixtures are defined in the `conftest.py` in the root of the repository.
60+
61+
### CMakeLists.txt
4462

4563
This CMakeLists.txt file shows the different parts required to build a ROS package:
4664

@@ -70,7 +88,7 @@ All shared folders are installed into the share directory. This includes the dir
7088
**39-45**:\
7189
The file always ends with a default test and the *ament_package()* command.
7290

73-
## package.xml
91+
### package.xml
7492

7593
The package.xml file is related to the CMakeLists.txt file:
7694

@@ -93,3 +111,36 @@ Next, we define other packages where our package depends on.
93111

94112
**23-28**:\
95113
The file ends with the default test dependency and an export definition.
114+
115+
### Custom messages, services and actions
116+
117+
We define custom messages, services and actions in our *rcdt_messages* package. This package has the following folder structure:
118+
119+
```text
120+
ros_package/
121+
| CMakeLists.txt
122+
| package.xml
123+
|
124+
└───msg/
125+
| | custom_message_definition.msg
126+
|
127+
└───srv/
128+
| | custom_service_definition.srv
129+
|
130+
└───action/
131+
| custom_action_definition.action
132+
```
133+
134+
In the CMake file, we automatically look for all msg, srv and action files and generate interfaces for them:
135+
136+
:::{literalinclude} example_files/ros_msgs_package/CMakeLists.txt
137+
:language: CMake
138+
:linenos:
139+
:::
140+
141+
To generate custom messages successfully, we also need to specify the following dependencies in the package.xml file:
142+
143+
```xml
144+
<buildtool_depend>rosidl_default_generators</buildtool_depend>
145+
<member_of_group>rosidl_interface_packages</member_of_group>
146+
```

docs/content/conventions/example_files/ros_msgs_package/CMakeLists.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,29 @@ find_package(rosidl_default_generators REQUIRED)
1313
find_package(geometry_msgs REQUIRED)
1414
find_package(vision_msgs REQUIRED)
1515

16-
# Service definitions:
16+
file(GLOB MSGS CONFIGURE_DEPENDS msg/*.msg*)
1717
file(GLOB SRVS CONFIGURE_DEPENDS srv/*.srv*)
18+
file(GLOB ACTIONS CONFIGURE_DEPENDS action/*.action*)
19+
20+
foreach(file IN LISTS MSGS)
21+
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" file_relative ${file})
22+
list(APPEND MSGS_STRIPPED ${file_relative})
23+
endforeach()
1824

1925
foreach(file IN LISTS SRVS)
2026
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" file_relative ${file})
2127
list(APPEND SRVS_STRIPPED ${file_relative})
2228
endforeach()
2329

30+
foreach(file IN LISTS ACTIONS)
31+
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" file_relative ${file})
32+
list(APPEND ACTIONS_STRIPPED ${file_relative})
33+
endforeach()
34+
2435
rosidl_generate_interfaces(${PROJECT_NAME}
36+
${MSGS_STRIPPED}
2537
${SRVS_STRIPPED}
38+
${ACTIONS_STRIPPED}
2639
DEPENDENCIES geometry_msgs vision_msgs
2740
)
2841

@@ -32,4 +45,4 @@ if(BUILD_TESTING)
3245
ament_lint_auto_find_test_dependencies()
3346
endif()
3447

35-
ament_package()
48+
ament_package()

docs/content/conventions/ros_package_msgs.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

docs/content/franka.md

Lines changed: 35 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,85 +6,69 @@ SPDX-License-Identifier: Apache-2.0
66

77
# Franka
88

9-
This page gives some background of the usage of our Franka-related packages.
10-
All software is based on the [Franka Emika Research](https://franka.de/products), based on the [Franka Control Interface](https://frankaemika.github.io/docs/overview.html)
9+
This page gives information about usage of the Franka Research 3.
1110

12-
## Quickstart robot in simulation
11+
## Physical robot
1312

14-
To start the simulation, run in 2 separate terminals:
13+
The physical robot can be started programmatically or manually.
1514

16-
```bash
17-
ros2 launch rcdt_franka franka.launch.py realsense:=True load_gazebo_ui:=True
18-
```
19-
20-
```bash
21-
ros2 run rosboard rosboard_node
22-
```
15+
### Quick start (manual)
2316

24-
This launches the robot in a gazebo world with a brick place on it.
25-
It also allows the inspection of sensor output on [localhost:8888](http://localhost:8888)
26-
The robot can be controled using a gamepad, or using moveit MotionPlanning in rviz under:
27-
`add>moveit_ros_visualization>MotionPanning`
17+
The following steps describe how to start the robot manually:
2818

29-
In order to run the brick pickup demo, open up 2 more terminals and run:
30-
31-
```bash
32-
ros2 launch rcdt_detection detection_services.launch.py
33-
```
34-
35-
```bash
36-
pyflow
37-
```
19+
- Start the robot (flip the button at the control box)
20+
- Connect your laptop with the control box's LAN port using an ethernet cable.
21+
- Make sure to use these ethernet settings:
3822

39-
The relevant pygraph is available under:
40-
`/home/rcdt/rcdt_robotics/pyflow/graphs/pick_brick.pygraph`
23+
Address: `172.16.0.1`\
24+
Netmask: `255.255.255.0`
4125

42-
## Quickstart physical robot
26+
![network](../img/franka/network.png)
4327

44-
When you have a properly configured physical robot and a realsense at your disposal. In 2 separate terminals, run:
28+
You may also want to consider making this a separate profile for future convenience.
4529

46-
```bash
47-
ros2 launch rcdt_franka franka.launch.py simulation:=False realsense:=True
48-
```
30+
- Go to [https://172.16.0.2](https://172.16.0.2), Franka Desk should now be reachable.
31+
- Login and click *unlock* to unlock the joints.
32+
- Click *My Franka Robot > Activate FCI* to activate FCI, the led's should become green.
33+
- Launch the franka launch file with *simulation=False*:
4934

5035
```bash
51-
ros2 run rosboard rosboard_node
36+
ros2 launch rcdt_franka franka.launch.py simulation:=False
5237
```
5338

54-
Running the brick pickup demo can be done in the same way.
39+
This should launch Rviz and show the state of the robot.
5540

41+
You can control the robot using a connected gamepad or using the *MotionPlanning* plugin in Rviz.
5642

57-
## Setup & FCI activation of physical robot
43+
### Quick start (programmatic)
5844

59-
### Programmatic unlock via `.env`
60-
61-
You can unlock the robot automatically without using the browser by setting environment variables in a `.env` file at the root of your workspace:
45+
You can also unlock and activate the FCI entirely from the command line by dropping a `.env` file in your workspace root:
6246

6347
```dotenv
6448
# .env
6549
FRANKA_HOSTNAME=your-hostname
6650
FRANKA_USERNAME=your-username
6751
FRANKA_PASSWORD=your-password
68-
```
52+
````
6953
70-
When you run the launch command, the robot will automatically unlock and activate the FCI.
54+
This functionallity is based on [jk-ethz/franka\_lock\_unlock](https://github.com/jk-ethz/franka_lock_unlock).
55+
With our fork with robot-specific enhancements: [https://github.com/alliander-opensource/franka\_lock\_unlock.git](https://github.com/alliander-opensource/franka_lock_unlock.git)
7156
72-
This feature is based on the [jk-ethz/franka\_lock\_unlock](https://github.com/jk-ethz/franka_lock_unlock) repository. We maintain a fork with specific enhancements for our robot at [alliander-opensource/franka\_lock\_unlock](https://github.com/alliander-opensource/franka_lock_unlock.git).
57+
Now when you run:
7358
74-
### Manual unlock via web interface
59+
```bash
60+
ros2 launch rcdt_franka franka.launch.py simulation:=False
61+
```
7562

76-
You can also manually lock the robot via the web interface, plug an Ethernet cable from your laptop into the control box’s LAN port (this is not the LAN port on the arm itself). Additionally, change your Ethernet IPv4 settings to **Manual** and set the following:
63+
the robot will automatically unlock and activate the FCI.
7764

78-
```text
79-
Address: 172.16.0.1
80-
Netmask: 255.255.255.0
81-
```
65+
## Simulation
8266

83-
![Network Setup](../img/franka/network.png)
67+
You can also start a simulation, without requiring a real Franka arm. Use the same launch file, but this time without the *simulation* flag:
8468

85-
You may also want to consider making this a separate profile for future convenience when moving to different networks.
69+
```bash
70+
ros2 launch rcdt_franka franka.launch.py
71+
```
8672

87-
If the robot's power switch is turned on, you should now be able to go to [https://172.16.0.2](https://172.16.0.2).
88-
Fill in the username and password, and click **Unlock**. After that, click **My Franka Robot → Activate FCI**. The robot is now ready to be controlled by the user, and the commands in Quickstart can be run.
73+
![franka](../img/franka/franka.png)
8974

90-
---TODO: screenshot here----

docs/content/mobile_manipulator.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
SPDX-FileCopyrightText: Alliander N. V.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
# Mobile Manipulator
8+
9+
The **Mobile Manipulator** combines the Husarion Panther base with the Franka Emika arm in a fully modular stack. By treating each as a separate ROS 2 package—`rcdt_panther` and `rcdt_franka`, we can compose them under a new `rcdt_mobile_manipulator` package without duplicating launch or test logic.
10+
11+
## Physical robot
12+
The Franka Emika arm is powered through the battery of the panther and controlled through the build-in computer of the Panther. The controller is connected to the Panther's computer.
13+
14+
1. First turn on the Panther and wait till the system is fully booted.
15+
2. Then run the following command to start the high-voltage system of the panther:
16+
17+
```bash
18+
ros2 service call /panther/hardware/aux_power_enable std_srvs/srv/SetBool "{data: true}"
19+
```
20+
3. After that, turn on the Franka arm by flipping the button at the control box.
21+
4. SSH in the build-in computer and start the combined system within the rcdt_robotics container with:
22+
23+
```bash
24+
ros2 launch rcdt_mobile_manipulator mobile_manipulator.launch.py simulation:=False
25+
```
26+
27+
## Simulation
28+
29+
Start the combined system with:
30+
31+
```bash
32+
ros2 launch rcdt_mobile_manipulator mobile_manipulator.launch.py
33+
```
34+
35+
![mobile-manipulator](../img/mobile_manipulator/rviz.png)
36+
37+
## Tests
38+
39+
By exposing the `rcdt_mobile_manipulator` launch description as a pytest fixture, you can **import and run** the existing Panther and Franka end-to-end tests against the combined system without any modification. Any improvements or fixes in the `rcdt_panther` and `rcdt_franka` test suites automatically apply when testing the mobile manipulator, keeping its codebase minimal and focused purely on orchestration.
40+
41+
42+

docs/content/moveit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Moveit can be used in different ways. The easiest is to use the MoveGroup interf
2929

3030
If more complexity is required, one can also use the C++ API of Moveit. This skips a layer of ROS, which leads to faster performances. Some of the C++ API is also available in the Python API. However, based on our experience, the Python functionalities and documentation are very minimal and we therefore advise to use the MoveGroup interface or the C++ API. More information about the differences can be found [here](https://moveit.picknik.ai/main/doc/examples/examples.html).
3131

32-
## How dow we use Moveit?
32+
## How do we use Moveit?
3333

34-
As mentioned before, we make use of the MoveGroup interface. One can start the `move_group` as a ros node of the `moveit_ros_move_group` package. However, the node requires many parameters to start and function correctly. Therefore, we always start the node using the launch file `moveit.launch.py`, located in our package `rcdt_moveit`, where we can easily pass the configuration parameters. Moveit configurations are defined in a separate package, which can be created for a desired robot arm using the [moveit setup assistant](https://moveit.picknik.ai/main/doc/examples/setup_assistant/setup_assistant_tutorial.html). For example, for the Franka robot arm, we created the `rcdt_franka_moveit_config` package. The move_group also requires information about the robot, like joint states. Therefore, the move_group can only be launched correctly while also launching the robot with some required functionalities. One can for example launch a simulation of our Franka robot using, which will by default start a robot simulation and moveit:
34+
As mentioned before, we make use of the MoveGroup interface. One can start the `move_group` as a ros node of the `moveit_ros_move_group` package. However, the node requires many parameters to start and function correctly. Therefore, we always start the node using the launch file `moveit.launch.py`, located in our package `rcdt_moveit`, where we can easily pass the configuration parameters. Moveit configurations are defined in a separate package, which can be created for a desired robot arm using the [Moveit setup assistant](https://moveit.picknik.ai/main/doc/examples/setup_assistant/setup_assistant_tutorial.html). For example, for the Franka robot arm, we created the `rcdt_franka_moveit_config` package. The move_group also requires information about the robot, like joint states. Therefore, the move_group can only be launched correctly while also launching the robot with some required functionalities. One can for example launch a simulation of our Franka robot using, which will by default start a robot simulation and Moveit:
3535

3636
```bash
3737
ros2 launch rcdt_franka franka.launch.py

0 commit comments

Comments
 (0)