Skip to content
Snippets Groups Projects
Commit 5e7e2f13 authored by beuchatp's avatar beuchatp
Browse files

Bug with agent ID subscription

parent 6da3890f
No related branches found
No related tags found
No related merge requests found
......@@ -732,6 +732,7 @@ void setpointCallback(const Setpoint& newSetpoint)
// class instance variable "xyz_yaw_to_follow_subscriber" is subscribed
void xyz_yaw_to_follow_callback(const Setpoint& newSetpoint)
{
//ROS_INFO("DEBUGGING: Received new setpoint from another agent");
// The setpoint should only be updated if allow by the respective booelan
if (shouldFollowAnotherAgent)
{
......@@ -891,7 +892,7 @@ void processLoadedParameters(ros::NodeHandle& nodeHandle)
// Subscribe to the "my_current_xyz_yaw_topic" of the agent ID
// that this agent should be following
xyz_yaw_to_follow_subscriber = nodeHandle.subscribe("/" + std::to_string(agentID_to_follow - 1) + "/my_current_xyz_yaw_topic", 1, xyz_yaw_to_follow_callback);
xyz_yaw_to_follow_subscriber = nodeHandle.subscribe("/" + std::to_string(agentID_to_follow) + "/my_current_xyz_yaw_topic", 1, xyz_yaw_to_follow_callback);
}
// Break out of the for loop as the assumption is that each agent ID
// appears only once in the "follow_in_a_line_agentIDs" vector of ID's
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment