Skip to content

Commit

Permalink
fixed avoidance bug
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Apr 21, 2024
1 parent 6a885b4 commit 1c5d5ce
Show file tree
Hide file tree
Showing 5 changed files with 1,074 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/mpc_tracker/mpc_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ void MpcTracker::callbackOtherMavTrajectory(const mrs_msgs::FutureTrajectory::Co
std::scoped_lock lock(mutex_other_uav_avoidance_trajectories_);

// update the diagnostics
other_uav_avoidance_trajectories_.emplace(trajectory.uav_name, trajectory);
other_uav_avoidance_trajectories_[trajectory.uav_name] = trajectory;
}
}

Expand All @@ -1631,7 +1631,7 @@ void MpcTracker::callbackOtherMavDiagnostics(const mrs_msgs::MpcTrackerDiagnosti
{
std::scoped_lock lock(mutex_other_uav_diagnostics_);

other_uav_diagnostics_.emplace(diagnostics.uav_name, diagnostics);
other_uav_diagnostics_[diagnostics.uav_name] = diagnostics;
}
}

Expand Down Expand Up @@ -1790,6 +1790,7 @@ double MpcTracker::checkTrajectoryForCollisions(int& first_collision_index) {
}
}
}

u++;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ uav_names: [
uav1:
type: "x500"
spawn:
x: 0.0
x: 5.0
y: 0.0
z: 5.0
heading: 0.0

uav2:
type: "x500"
spawn:
x: 5.0
x: 0.0
y: 0.0
z: 5.0
heading: 0.0
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
<arg name="UAV_NAME" default="uav2" />
</include>

<!-- <node pkg="rviz" type="rviz" name="rviz1" args="-d $(dirname)/rviz1.rviz" /> -->
<!-- <node pkg="rviz" type="rviz" name="rviz2" args="-d $(dirname)/rviz2.rviz" /> -->

<test pkg="$(arg package)" type="test_$(arg test_name)" test-name="$(arg test_name)" time-limit="60.0">
<param name="test" value="$(arg test_name)" />
</test>
Expand Down
Loading

0 comments on commit 1c5d5ce

Please sign in to comment.