Skip to content

Commit

Permalink
Make a supplement.
Browse files Browse the repository at this point in the history
  • Loading branch information
liyixin135 committed Jul 22, 2024
1 parent 77425cc commit ed16410
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/chassis_gimbal_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,15 @@ void ChassisGimbalManual::setChassisMode(int mode)
case rm_msgs::ChassisCmd::RAW:
chassis_cmd_sender_->setMode(rm_msgs::ChassisCmd::RAW);
is_gyro_ = true;
if (x_scale_ != 0.0 || y_scale_ != 0.0)
vel_cmd_sender_->setAngularZVel(gyro_rotate_reduction_);
else
vel_cmd_sender_->setAngularZVel(1.0);
break;
case rm_msgs::ChassisCmd::FOLLOW:
chassis_cmd_sender_->setMode(rm_msgs::ChassisCmd::FOLLOW);
is_gyro_ = false;
vel_cmd_sender_->setAngularZVel(0.0);
break;
}
}
Expand Down
8 changes: 0 additions & 8 deletions src/chassis_gimbal_shooter_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,16 +399,11 @@ void ChassisGimbalShooterManual::cPress()
if (is_gyro_)
{
setChassisMode(rm_msgs::ChassisCmd::FOLLOW);
vel_cmd_sender_->setAngularZVel(0.0);
}
else
{
setChassisMode(rm_msgs::ChassisCmd::RAW);
chassis_cmd_sender_->power_limit_->updateState(rm_common::PowerLimit::NORMAL);
if (x_scale_ != 0.0 || y_scale_ != 0.0)
vel_cmd_sender_->setAngularZVel(gyro_rotate_reduction_);
else
vel_cmd_sender_->setAngularZVel(1.0);
}
}

Expand Down Expand Up @@ -585,10 +580,7 @@ void ChassisGimbalShooterManual::vPress()
void ChassisGimbalShooterManual::shiftPress()
{
if (chassis_cmd_sender_->getMsg()->mode != rm_msgs::ChassisCmd::FOLLOW && is_gyro_)
{
setChassisMode(rm_msgs::ChassisCmd::FOLLOW);
vel_cmd_sender_->setAngularZVel(1.0);
}
chassis_cmd_sender_->power_limit_->updateState(rm_common::PowerLimit::BURST);
}

Expand Down

0 comments on commit ed16410

Please sign in to comment.