Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing warehouse services #474

Merged
merged 2 commits into from
Mar 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 18 additions & 3 deletions moveit_ros/warehouse/warehouse/src/warehouse_services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,26 @@ int main(int argc, char** argv)
int port;
node.param<std::string>("warehouse_host", host, "localhost");
node.param<int>("warehouse_port", port, 33829);
warehouse_ros::DatabaseConnection::Ptr conn;

warehouse_ros::DatabaseConnection::Ptr conn = moveit_warehouse::loadDatabase();
conn->setParams(host, port, 5.0);
try
{
conn = moveit_warehouse::loadDatabase();
conn->setParams(host, port, 5.0);

ROS_INFO("Connecting to warehouse on %s:%d", host.c_str(), port);
if (!conn->connect())
{
ROS_ERROR("Failed to connect to DB on %s:%d", host.c_str(), port);
return 1;
}
}
catch (std::exception& ex)
{
ROS_ERROR("%s", ex.what());
return 1;
}

ROS_INFO("Connecting to warehouse on %s:%d", host.c_str(), port);
moveit_warehouse::RobotStateStorage rs(conn);

std::vector<std::string> names;
Expand Down