diff --git a/doc/persistent_scenes_and_states/persistent_scenes_and_states.rst b/doc/persistent_scenes_and_states/persistent_scenes_and_states.rst new file mode 100644 index 000000000..029f23d26 --- /dev/null +++ b/doc/persistent_scenes_and_states/persistent_scenes_and_states.rst @@ -0,0 +1,63 @@ +Warehouse - Persistent Scenes and States +======================================== + +The "MotionPlanning" plugin of RViz offers the possibility to save +complete planning scenes and robot states persistently. +Currently, two storage plugins (based on +`warehouse_ros `_) are available: + +* `warehouse_ros_mongo `_, which uses MongoDB as backend +* `warehouse_ros_sqlite `_, which uses SQLite as backend + +You can install both of them with your favourite package manager +(e.g. ``apt-get install ros-noetic-warehouse-ros-mongo``) or +`build them from source <../getting_started/getting_started.html>`_ +(of course, you'll have to check out the corresponding repository into your ``src`` folder for that). + +Storage plugin selection +------------------------ + +The warehouse plugin and settings have to be specified in the launch files of your MoveIt configuration. +You should adapt ``warehouse_settings.launch.xml`` and possibly also ``warehouse.launch`` if you do not wish to use the MongoDB plugin. +The storage plugin is determined by the parameter ``warehouse_plugin``. +Valid options are ``warehouse_ros_mongo::MongoDatabaseConnection`` for MongoDB and +``warehouse_ros_sqlite::DatabaseConnection`` for SQLite. +Furthermore, the parameters ``warehouse_host`` and ``warehouse_port`` configure the connection details. +In case of the SQLite plugin, ``warehouse_host`` contains the path to the database file, +and ``warehouse_port`` is unused. + +.. tutorial-formatter:: ./warehouse_settings.launch.xml + +.. tutorial-formatter:: ./warehouse.launch + +Connecting to the storage backend +--------------------------------- + +After choosing the storage plugin and configuring the launch file(s), +run RViz using :: + + roslaunch moveit_resources_panda_moveit_config demo.launch db:=true + +In RViz, make sure that the "MotionPlanning" plugin is present in the "Displays" view. +Otherwise add it with the "Add" button below. +Navigate to the "Context" tab of the "MotionPlanning" window. +Verify the connection details (host/port for MongoDB, file path for SQLite) +and click on "Connect". + +.. image:: rviz_connect.png + :width: 600px + +After that, a dialogue box will appear and ask you whether you'd like to erase all current +states and scenes in RViz (not in the database, the persistent data is not affected by that). +As you just started RViz, you can safely select "yes". + +Saving/Loading scenes and states +-------------------------------- + +Now that you connected successfully, +you can save and restore robot states and planned scenes. +This can be done in the "Stored Scenes" resp. "Stored States" tab in RViz. + +To save a start state, drag the green manipulator to the correct position and click "Save Start". +The goal state (orange manipulator) can be saved with the "Save Goal" button. +To restore a state, select it in the list and click on "Set as Start" resp. "Set as Goal". diff --git a/doc/persistent_scenes_and_states/rviz_connect.png b/doc/persistent_scenes_and_states/rviz_connect.png new file mode 100644 index 000000000..ba1be11fc Binary files /dev/null and b/doc/persistent_scenes_and_states/rviz_connect.png differ diff --git a/doc/persistent_scenes_and_states/warehouse.launch b/doc/persistent_scenes_and_states/warehouse.launch new file mode 100644 index 000000000..57e719d26 --- /dev/null +++ b/doc/persistent_scenes_and_states/warehouse.launch @@ -0,0 +1,19 @@ + + + + + + + + +## BEGIN_TUTORIAL +## Optionally, start the MongoDB Server (comment/uncomment the following in ``warehouse.launch``) + +## END_TUTORIAL + + + + diff --git a/doc/persistent_scenes_and_states/warehouse_settings.launch.xml b/doc/persistent_scenes_and_states/warehouse_settings.launch.xml new file mode 100644 index 000000000..4d320d49c --- /dev/null +++ b/doc/persistent_scenes_and_states/warehouse_settings.launch.xml @@ -0,0 +1,20 @@ + +## BEGIN_TUTORIAL + + +## Parameters for warehouse_ros_sqlite + + + + +## For warehouse_ros_mongodb use the following instead + + +## END_TUTORIAL + + + + + diff --git a/doc/quickstart_in_rviz/quickstart_in_rviz_tutorial.rst b/doc/quickstart_in_rviz/quickstart_in_rviz_tutorial.rst index 9037a839b..a53cead5d 100644 --- a/doc/quickstart_in_rviz/quickstart_in_rviz_tutorial.rst +++ b/doc/quickstart_in_rviz/quickstart_in_rviz_tutorial.rst @@ -235,3 +235,5 @@ Next Tutorials * To easily control your robot using Python, check out the `Move Group Python Interface <../move_group_python_interface/move_group_python_interface_tutorial.html>`_ * To create your own ``*_moveit_config`` package, check out the `Setup Assistant <../setup_assistant/setup_assistant_tutorial.html>`_ + +* Save and restore robot states from a database or from disk using `warehouse_ros <../persistent_scenes_and_states/persistent_scenes_and_states.html>`_ diff --git a/index.rst b/index.rst index 2a6d746d4..f10a6cbc1 100644 --- a/index.rst +++ b/index.rst @@ -83,6 +83,7 @@ Configuration doc/trajopt_planner/trajopt_planner_tutorial doc/pilz_industrial_motion_planner/pilz_industrial_motion_planner doc/planning_adapters/planning_adapters_tutorial.rst + doc/persistent_scenes_and_states/persistent_scenes_and_states Miscellaneous ----------------------------