Skip to content

Commit

Permalink
Modify the method of count cycle.
Browse files Browse the repository at this point in the history
  • Loading branch information
liyixin135 committed Jul 26, 2024
1 parent e0d724f commit 3fa7c25
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/chassis_gimbal_shooter_cover_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,15 @@ void ChassisGimbalShooterCoverManual::mouseRightPress()
{
gimbal_cmd_sender_->setMode(rm_msgs::GimbalCmd::TRAJ);
double traj_yaw = M_PI * count_ / 900;
double traj_pitch = 0.15 * sin(2 * M_PI * count_ / 900) + 0.2;
count_ = (count_ + 1) % 900;
double traj_pitch = 0.15 * sin(2 * M_PI * (count_ % 900) / 900) + 0.15;
count_++;
gimbal_cmd_sender_->setYawAndPitchTraj(traj_yaw, traj_pitch);
shooter_cmd_sender_->setMode(rm_msgs::ShootCmd::READY);
}
else
{
shooter_cmd_sender_->setMode(rm_msgs::ShootCmd::PUSH);
}
}
else if (!mouse_left_event_.getState() && shooter_cmd_sender_->getMsg()->mode == rm_msgs::ShootCmd::PUSH)
shooter_cmd_sender_->setMode(rm_msgs::ShootCmd::READY);
Expand Down

0 comments on commit 3fa7c25

Please sign in to comment.