Skip to content

Commit 715be82

Browse files
gleichdickv4hn
andauthored
Add tutorial for warehouse_ros(_sqlite) (#658)
* Add tutorial for warehouse_ros(_sqlite) * Update doc/persistent_scenes_and_states/warehouse.launch * rename tutorial looking through the list of all tutorials I failed to find it for a minute or so... * refer to the launch files to modify in the beginning * do not advertise MongoDB as default Co-authored-by: Bjar Ne <[email protected]> Co-authored-by: Michael Görner <[email protected]>
1 parent 456b1f6 commit 715be82

File tree

6 files changed

+105
-0
lines changed

6 files changed

+105
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Warehouse - Persistent Scenes and States
2+
========================================
3+
4+
The "MotionPlanning" plugin of RViz offers the possibility to save
5+
complete planning scenes and robot states persistently.
6+
Currently, two storage plugins (based on
7+
`warehouse_ros <https://github.com/ros-planning/warehouse_ros>`_) are available:
8+
9+
* `warehouse_ros_mongo <https://github.com/ros-planning/warehouse_ros_mongo>`_, which uses MongoDB as backend
10+
* `warehouse_ros_sqlite <https://github.com/gleichdick/warehouse_ros_sqlite>`_, which uses SQLite as backend
11+
12+
You can install both of them with your favourite package manager
13+
(e.g. ``apt-get install ros-noetic-warehouse-ros-mongo``) or
14+
`build them from source <../getting_started/getting_started.html>`_
15+
(of course, you'll have to check out the corresponding repository into your ``src`` folder for that).
16+
17+
Storage plugin selection
18+
------------------------
19+
20+
The warehouse plugin and settings have to be specified in the launch files of your MoveIt configuration.
21+
You should adapt ``warehouse_settings.launch.xml`` and possibly also ``warehouse.launch`` if you do not wish to use the MongoDB plugin.
22+
The storage plugin is determined by the parameter ``warehouse_plugin``.
23+
Valid options are ``warehouse_ros_mongo::MongoDatabaseConnection`` for MongoDB and
24+
``warehouse_ros_sqlite::DatabaseConnection`` for SQLite.
25+
Furthermore, the parameters ``warehouse_host`` and ``warehouse_port`` configure the connection details.
26+
In case of the SQLite plugin, ``warehouse_host`` contains the path to the database file,
27+
and ``warehouse_port`` is unused.
28+
29+
.. tutorial-formatter:: ./warehouse_settings.launch.xml
30+
31+
.. tutorial-formatter:: ./warehouse.launch
32+
33+
Connecting to the storage backend
34+
---------------------------------
35+
36+
After choosing the storage plugin and configuring the launch file(s),
37+
run RViz using ::
38+
39+
roslaunch moveit_resources_panda_moveit_config demo.launch db:=true
40+
41+
In RViz, make sure that the "MotionPlanning" plugin is present in the "Displays" view.
42+
Otherwise add it with the "Add" button below.
43+
Navigate to the "Context" tab of the "MotionPlanning" window.
44+
Verify the connection details (host/port for MongoDB, file path for SQLite)
45+
and click on "Connect".
46+
47+
.. image:: rviz_connect.png
48+
:width: 600px
49+
50+
After that, a dialogue box will appear and ask you whether you'd like to erase all current
51+
states and scenes in RViz (not in the database, the persistent data is not affected by that).
52+
As you just started RViz, you can safely select "yes".
53+
54+
Saving/Loading scenes and states
55+
--------------------------------
56+
57+
Now that you connected successfully,
58+
you can save and restore robot states and planned scenes.
59+
This can be done in the "Stored Scenes" resp. "Stored States" tab in RViz.
60+
61+
To save a start state, drag the green manipulator to the correct position and click "Save Start".
62+
The goal state (orange manipulator) can be saved with the "Save Goal" button.
63+
To restore a state, select it in the list and click on "Set as Start" resp. "Set as Goal".
29.2 KB
Loading
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<launch>
2+
3+
<!-- The path to the database must be specified -->
4+
<arg name="moveit_warehouse_database_path" />
5+
6+
<!-- Load warehouse parameters -->
7+
<include file="$(find moveit_resources_panda_moveit_config)/launch/warehouse_settings.launch.xml" />
8+
9+
## BEGIN_TUTORIAL
10+
## Optionally, start the MongoDB Server (comment/uncomment the following in ``warehouse.launch``)
11+
<!-- <node name="$(anon mongo_wrapper_ros)" cwd="ROS_HOME" type="mongo_wrapper_ros.py" pkg="warehouse_ros_mongo">
12+
<param name="overwrite" value="false"/>
13+
<param name="database_path" value="$(arg moveit_warehouse_database_path)" />
14+
</node> -->
15+
## END_TUTORIAL
16+
17+
18+
19+
</launch>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<launch>
2+
## BEGIN_TUTORIAL
3+
<!-- Set the parameters for the warehouse. -->
4+
5+
## Parameters for warehouse_ros_sqlite
6+
<arg name="moveit_warehouse_host" default="/path/to/your/file.sqlite" />
7+
<arg name="moveit_warehouse_port" default="0" />
8+
<param name="warehouse_plugin" value="warehouse_ros_sqlite::DatabaseConnection" />
9+
10+
## For warehouse_ros_mongodb use the following instead
11+
<!-- <arg name="moveit_warehouse_port" default="33829" />
12+
<arg name="moveit_warehouse_host" default="localhost" />
13+
<param name="warehouse_plugin" value="warehouse_ros_mongo::MongoDatabaseConnection" /> -->
14+
15+
## END_TUTORIAL
16+
17+
<!-- Set parameters for the warehouse -->
18+
<param name="warehouse_port" value="$(arg moveit_warehouse_port)"/>
19+
<param name="warehouse_host" value="$(arg moveit_warehouse_host)"/>
20+
</launch>

doc/quickstart_in_rviz/quickstart_in_rviz_tutorial.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,5 @@ Next Tutorials
235235
* To easily control your robot using Python, check out the `Move Group Python Interface <../move_group_python_interface/move_group_python_interface_tutorial.html>`_
236236

237237
* To create your own ``*_moveit_config`` package, check out the `Setup Assistant <../setup_assistant/setup_assistant_tutorial.html>`_
238+
239+
* Save and restore robot states from a database or from disk using `warehouse_ros <../persistent_scenes_and_states/persistent_scenes_and_states.html>`_

index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Configuration
8383
doc/trajopt_planner/trajopt_planner_tutorial
8484
doc/pilz_industrial_motion_planner/pilz_industrial_motion_planner
8585
doc/planning_adapters/planning_adapters_tutorial.rst
86+
doc/persistent_scenes_and_states/persistent_scenes_and_states
8687

8788
Miscellaneous
8889
----------------------------

0 commit comments

Comments
 (0)