0
$\begingroup$

Rosanswers logo

I dont have clear idea of using table_top detector and how to restore the household objects database in pgadmin3.Can anyone guide me through this?


Originally posted by umakarthiga on ROS Answers with karma: 11 on 2012-12-13

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Household objects database is used by Tabletop object recognition.

To install household objects database server, you can refer to this page. But I can give you steps.

To create server

1.Open a terminal, type

sudo apt-get install postgresql

2.After the installation, type the command below to become user postgres

sudo su - postgres

For example, it's like

rosfuerte@rosfuerte-K53SM:~$ sudo su - postgres
[sudo] password for rosfuerte: 
postgres@rosfuerte-K53SM:~$

3.Next, type psql to enter postgre sql interpreter, it's like

postgres@rosfuerte-K53SM:~$ psql
psql (9.1.6)
Type "help" for help.

postgres=#

4.Then, add a new user willow by entering CREATE ROLE ...(Don't forget the semicolon)

postgres=# CREATE ROLE willow LOGIN CREATEDB CREATEROLE PASSWORD 'willow';

5.Leave the interpreter

postgres=# \q
postgres@rosfuerte-K53SM:~$

To make connection over TCP/IP works

1.Get the paths of the files(pg_hba.conf & postgresql.conf) you need to modify

postgres@rosfuerte-K53SM:~$ ps auxw | grep postgresql
postgres  1170  0.0  0.1 132084 10400 ?        S    09:53   0:00 /usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf
postgres  4095  0.0  0.0  13612   916 pts/1    S+   11:32   0:00 grep postgresql

2.Modify pg_hba.conf(usually is /etc/postgresql/9.1/main/pg_hba.conf), You need to add these two lines in the bottom of this file

# Anybody through TCP/IP with password
host    all         all         0.0.0.0   0.0.0.0     md5

3.Modify postgresql.conf(usually is /etc/postgresql/9.1/main/postgresql.conf), add this line to the file

listen_addresses = '*'

4.Log out postgres user

exit

5.Reboot your computer

To add object database to server

1.Install PGAdmin3

sudo apt-get install pgadmin3

2.Launch PGAdmin3 by enter

pgadmin3

3.Press the plugin button on the upper-left of PGAdmin GUI

4.Enter the name(whatever name you want)

5.Set the host, enter "localhost"

6.Enter password, which is "willow"

7.When your GUI looks like this, press OK

image description

8.Now you can see your server on Object Browser on the left, press right button of the mouse on "Databases" under the server

9.Choose "New Database..."

10.Set the name and the owner, like(you should follow the name in the picture below) image description

11.Press right button of the mouse on the newly added database

12.Press "Restore..."

13.Download the database backup file by

svn export https://code.ros.org/svn/data/trunk/household_objects/household_objects-0.6_fuerte_prerelease_1.backup

14.Restore the file

image description

15.Press "Restore"(Restore process need some time to complete), then you finished installing the household objects database


To use this database, you first need to create a yaml file, for example, I should create my_server.yaml

household_objects_database:
  database_host: localhost
  database_port: 5432
  database_user: willow
  database_pass: willow
  database_name: household_objects

To integrate the database with tabletop object detector, you should create a launch file(in this example, I created a package named ricky_tabletop_object_detector, I put my_server.yaml in ricky_tabletop_object_detector/yaml/, and put this launch file in ricky_tabletop_object_detector/launch/)

<launch>
  <!-- set stereo to true for narrow stereo, false for kinect -->
  <arg name="stereo" default="true" />
  <arg name="use_slip_controllers" default="false"/>
  <arg name="use_right_arm" default="true"/>
  <arg name="use_left_arm" default="true"/>
  <arg name="use_task_cartesian" default="false"/>
  <arg name="log_to_warehouse" default="false"/>
  <arg name="flatten_table" default="false"/>
  <arg name="kinect_frame_prefix" default="/head_mount_kinect" />
  <arg name="kinect_camera_name" default="head_mount_kinect" />
  <arg name="sim" default="false"/>

  <!-- client for object database running on remote server at Willow Garage -->
  <!-- DOES NOT WORK IN TRUNK RIGHT NOW -->
  <!--
  <include file="$(find household_objects_database)/launch/objects_database_remote_client.launch"/>
  -->

  <!-- alternative option: database server running on a local machine -->
  <rosparam command="load" file="$(find ricky_tabletop_object_detector)/yaml/my_server.yaml"/>
  <node pkg="household_objects_database" name="objects_database_node" type="objects_database_node" 
    respawn="true" output="screen"/>    

  <!-- manipulation prerequisites -->
  <include file="$(find pr2_object_manipulation_launch)/launch/pr2_manipulation_prerequisites.launch">
    <arg name="stereo" value="$(arg stereo)"/>    
    <arg name="use_left_arm" value="$(arg use_left_arm)"/>    
    <arg name="use_right_arm" value="$(arg use_right_arm)"/>    
    <arg name="log_to_warehouse" value="$(arg log_to_warehouse)"/>
    <arg name="kinect_frame_prefix" value="$(arg kinect_frame_prefix)"/>
    <arg name="sim" value="$(arg sim)"/>
  </include>

  <!-- manipulation -->
  <include file="$(find pr2_object_manipulation_launch)/launch/pr2_manipulation.launch">
    <arg name="use_slip_controllers" value="$(arg use_slip_controllers)"/>
    <arg name="use_left_arm" value="$(arg use_left_arm)"/>
    <arg name="use_right_arm" value="$(arg use_right_arm)"/>
    <arg name="use_task_cartesian" value="$(arg use_task_cartesian)"/>
    <arg name="sim" value="$(arg sim)"/>
  </include>

  <!-- tabletop collision map processing -->
  <node pkg="tabletop_collision_map_processing" name="tabletop_collision_map_processing" 
        type="tabletop_collision_map_processing_node" respawn="false" output="screen"/>
  <param name="tabletop_collision_map_processing/get_model_mesh_srv" 
         value="/objects_database_node/get_model_mesh" />
  <param name="tabletop_collision_map_processing/static_map_cloud_name" value="full_cloud_filtered" />

  <!-- tabletop segmentation and object recognition -->
  <include file="$(find tabletop_object_detector)/launch/tabletop_complete.launch">
      <arg unless="$(arg stereo)" name="tabletop_segmentation_points_input" value="$(arg kinect_camera_name)/depth_registered/points"/>
      <arg if="$(arg stereo)" name="tabletop_segmentation_points_input" value="narrow_stereo_textured/points2"/>
      <arg name="flatten_table" value="$(arg flatten_table)"/>
  </include>

</launch>

Originally posted by Po-Jen Lai with karma: 1371 on 2012-12-13

This answer was ACCEPTED on the original site

Post score: 6


Original comments

Comment by Amal on 2012-12-15:
How to remove it ?!!

Comment by Po-Jen Lai on 2012-12-15:
Why you need to remove the database? If you don't want to use this database, you can select the datadase a node use by modifying .yaml file

Comment by Amal on 2012-12-15:
I want to use but I have a problem in pg_hba.conf file it not accessible... so I have some thing to do but want to remove it first then install !! do you have any suggestion ?!

Comment by Po-Jen Lai on 2012-12-15:
you mean you cannot edit /etc/postgresql/9.1/main/pg_hba.conf? If you want to remove postgresql, use sudo apt-get purge postgresql

Comment by Amal on 2012-12-16:
yes, I can not edit it any way. Do you have any suggestion about this ?!

Comment by Po-Jen Lai on 2012-12-16:
Are you editing it when you are user postgres?

Comment by umakarthiga on 2012-12-17:
@Ricky Thanks a lot.I will try on this

Comment by Po-Jen Lai on 2012-12-17:
Welcome : ) Feel free to ask~

Comment by RiskTeam on 2013-03-09:
@ricky Where should I put the ricky_tabletop_object_detector file ? should I put it at " /home/risk/ros " !!

Comment by Po-Jen Lai on 2013-03-09:
ricky_tabletop_object_detector is a package I created, if you created this package too, you should put it in your ROS path.

Comment by RiskTeam on 2013-03-09:
Thank you so much .

Comment by Po-Jen Lai on 2013-03-10:
You are welcome: )

Comment by jontromanab on 2013-03-16:
@Amal....................I think for modifying the file pg_hba.conf, you should go to the root or sudo user, then you can edit or access the file.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.