-
Context is with two participants, one with full-control fleet adapter, p1, and another with Negotiation happens with the following logs but I cant make up what is actually happening after looking at the print negotiation status cpp file
the below happens if
p2 implementation code node->writer->async_make_participant(
std::move(description),
[id, t = std::move(t), map_name](rmf_traffic::schedule::Participant p)
{
const int p_id = p.id();
const std::map<int, Eigen::Vector3d>::iterator it = map.find(id);
if (it != map.end()) {
std::swap(map[p_id], it->second);
map.erase(it);
}
node->participant[p_id] = std::move(p);
RCLCPP_INFO(node->get_logger(), "Created participant with id: %d", p_id);
print_detection_map();
node->participant[p_id]->set({{map_name, std::move(t)}});
auto negotiator = std::make_unique<rmf_traffic::schedule::StubbornNegotiator>(p);
//node->_negotiation->register_negotiator(p_id, std::move(negotiator)); <--- causes node to shutdown
//auto mirror_future = rmf_traffic_ros2::schedule::make_mirror(
//*node, rmf_traffic::schedule::query_all());
//node->_mirror = mirror_future.get();
//node->_negotiation = rmf_traffic_ros2::schedule::Negotiation(
//*node, node->_mirror->snapshot_handle());
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 22 replies
-
I apologize for the esoteric printouts. We have plans to make more user-friendly introspection tools, but that hasn't reached the top of our priority list yet (though I expect it will soon).
This means that participant 1 has offered its ideal proposal, but participant 4 has not been responding to the negotiation at all. In general,
To be pedantic, "node shutdown" typically refers to a graceful intentional exit. In this case, we won't get a shutdown, we will get a segmentation fault. Earlier on this line:
you used move semantics on The easiest way to get this working would be to change it to the following:
I see one other error which will also cause your negotiations to get stuck. When you call
you are discarding the handle that gets returned. As stated here in the documentation, this is a problem, because the negotiator will be immediately unregistered, so it will never participant in negotiating. To solve this, I would recommend something like this:
Then to fill this in, you can put this in your callback:
Nothing should be needed after that.
You don't need to call the
You should create exactly one |
Beta Was this translation helpful? Give feedback.
I apologize for the esoteric printouts. We have plans to make more user-friendly introspection tools, but that hasn't reached the top of our priority list yet (though I expect it will soon).
This means that participant 1 has offered its ideal proposal, but participant 4 has not been responding to the negotiation at all. In general,
[a:#]
means the negotiation is waiting on participanta
to respond.