Skip to content

Commit

Permalink
[aerial_robot_base] modify ~ to ! to express negative; add comment fo…
Browse files Browse the repository at this point in the history
…r tolerance selection
  • Loading branch information
Li-Jinjie committed Feb 1, 2024
1 parent 5f84ed9 commit 8d90df4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aerial_robot_base/src/aerial_robot_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ AerialRobotBase::~AerialRobotBase()

void AerialRobotBase::mainFunc(const ros::TimerEvent & e)
{
if (~e.last_real.isZero())
if (!e.last_real.isZero())
{
double dt_real = e.current_real.toSec() - e.last_real.toSec();
double tolerance = 0.05;
double tolerance = 0.05; // 5% tolerance. This value is set based on experience.
double dt_desire = (1.0 + tolerance) * 1.0 / main_rate_;
if (dt_real > dt_desire)
{
Expand Down

0 comments on commit 8d90df4

Please sign in to comment.