| Note: This tutorial assumes you have a PostgreSQL server installed and running on a local machine. This step is covered in the Installing a PostgreSQL server tutorial.. |
Install the household_objects_database on your local database server
Description: Shows how to create the household_objects_database on your local database server, and how to populate it using a backup file from Willow Garage.Tutorial Level: BEGINNER
Database Creation
start pgadmin3, then log into your PostgreSQL server.
in the server drop-down list, right-click Databases and choose New Database...
in the dialog menu that appears, set the desired name for your database (e.g. household_objects-0.2) and click OK.
Restore the Database from a Backup File
Download the desired version of the database backup file from Willow Garage. You can find the database backup files here:
https://code.ros.org/svn/data/trunk/household_objects/
In general, if you have an up-to-date installation of cturtle (and thus the manipulation pipeline) it is recommended you use the latest version of the database as well. Note that if a backup file is called *-schema.backup it will only contain the schema of the database, but no data.
After downloading the backup file, go back to pgadmin3. Right-click your newly created database, and click Restore.... Point the dialog to the backup file you downloaded and click OK. Wait for the restoration to finish, then close the dialog.
Using the Database
You must now point the ROS wrapper node for the database at your newly created database. The simplest way of doing this is to create a parameter file, and then a launch file which uses those parameters.
Create your parameter file, called for example some_package_name/config/my_server.yaml. Use the example below, replacing the values with the correct ones for your system:
household_objects_database: database_host: myserver.mydomain.com database_port: 5432 database_user: willow database_pass: willow database_name: household_objects
Then, you can create a launch file to start the database wrapper node:
<launch>
<!-- load database connection parameters -->
<rosparam command="load"
file="$(find some_package_name)/config/my_server.yaml"/>
<!-- start the database wrapper node -->
<node pkg="household_objects_database" name="objects_database_node"
type="objects_database_node" respawn="true" output="screen"/>
</launch>That's it, you are done!






