diff --git a/src/delutil.cc b/src/delutil.cc index 1995be8416b321a60733ef39b43132a686f645be..66da16bb8c4bddceab55a70b28b3836aa28c892c 100644 --- a/src/delutil.cc +++ b/src/delutil.cc @@ -2,7 +2,7 @@ #include "lrs_srvs_del/PrioritizeUnits.h" #include "lrs_srvs_del/PrioritizeUnitsResult.h" -#include "lrs_srvs_del/GetBid.h" +#include "lrs_msgs_common/GetBid.h" #include "lrs_srvs_del/FIPADelegate.h" #include "lrs_srvs_del/FIPACnpStatus.h" #include "lrs_srvs_del/FIPASetAcceptProposal.h" @@ -56,21 +56,22 @@ bool unit_prioritize_result (int request_id, int & n_bids, std::vector<std::stri } -int get_bid (std::string ns, std::string json) { - ROS_INFO ("get_bid: %s - %s", ns.c_str(), json.c_str()); +int get_bid (std::string ns, std::string unit, std::string json) { + ROS_INFO ("get_bid: %s - %s - %s", ns.c_str(), unit.c_str(), json.c_str()); int res = -1; ros::NodeHandle n; ostringstream os; - os << ns << "/bidder/" << "get_bid"; + os << ns << "/" << "get_bid"; - ros::ServiceClient client = n.serviceClient<lrs_srvs_del::GetBid>(os.str()); + ros::ServiceClient client = n.serviceClient<lrs_msgs_common::GetBid>(os.str()); - lrs_srvs_del::GetBid srv; - srv.request.json = json; + lrs_msgs_common::GetBid srv; + srv.request.ns = unit; + srv.request.json_tst = json; if (client.call(srv)) { - res = srv.response.cost; + res = srv.response.bid; } else { ROS_ERROR("delutil.cc get_bid: Failed to call get_bid: %s", os.str().c_str()); res = -1; diff --git a/src/delutil.h b/src/delutil.h index d4e930ecf13764620aff53038bba6cd2f0eee847..50dc37f348df6b1b79a79be3b4b122a87f3bcbae 100644 --- a/src/delutil.h +++ b/src/delutil.h @@ -13,7 +13,7 @@ int unit_prioritize (std::vector<std::string> units, std::string ns, int id); bool unit_prioritize_result (int request_id, int & n_bids, std::vector<std::string> & units); -int get_bid (std::string ns, std::string tstns, int id); +int get_bid (std::string ns, std::string unit, std::string json); std::string delegate(std::string ns, std::string tstns, int tstid, lrs_msgs_del::DelArgs delargs); std::string delegate(std::string ns, std::string tstns, int tstid, lrs_msgs_del::DelArgs delargs,