Skip to content

Commit

Permalink
Use dbusFeedforward for chassis only when gimbal in rate.
Browse files Browse the repository at this point in the history
  • Loading branch information
liyixin135 committed Jul 17, 2024
1 parent 86eac74 commit d729e97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/chassis_gimbal_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ void ChassisGimbalManual::updateRc(const rm_msgs::DbusData::ConstPtr& dbus_data)
{
ManualBase::updateRc(dbus_data);
gimbal_cmd_sender_->setRate(-dbus_data->ch_l_x, -dbus_data->ch_l_y);
chassis_cmd_sender_->setFollowVelDes(gimbal_cmd_sender_->getMsg()->rate_yaw);
}

void ChassisGimbalManual::updatePc(const rm_msgs::DbusData::ConstPtr& dbus_data)
{
ManualBase::updatePc(dbus_data);
gimbal_cmd_sender_->setRate(-dbus_data->m_x * gimbal_scale_, dbus_data->m_y * gimbal_scale_);
chassis_cmd_sender_->setFollowVelDes(gimbal_cmd_sender_->getMsg()->rate_yaw);
}

void ChassisGimbalManual::checkReferee()
Expand Down
8 changes: 8 additions & 0 deletions src/chassis_gimbal_shooter_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ void ChassisGimbalShooterManual::updateRc(const rm_msgs::DbusData::ConstPtr& dbu

if (shooter_cmd_sender_->getMsg()->mode != rm_msgs::ShootCmd::STOP)
gimbal_cmd_sender_->setBulletSpeed(shooter_cmd_sender_->getSpeed());
if (gimbal_cmd_sender_->getMsg()->mode == rm_msgs::GimbalCmd::RATE)
chassis_cmd_sender_->setFollowVelDes(gimbal_cmd_sender_->getMsg()->rate_yaw);
else
chassis_cmd_sender_->setFollowVelDes(0);
}

void ChassisGimbalShooterManual::updatePc(const rm_msgs::DbusData::ConstPtr& dbus_data)
Expand All @@ -265,6 +269,10 @@ void ChassisGimbalShooterManual::updatePc(const rm_msgs::DbusData::ConstPtr& dbu
else if (chassis_power_ < 6.0 && chassis_cmd_sender_->getMsg()->mode == rm_msgs::ChassisCmd::FOLLOW)
chassis_cmd_sender_->power_limit_->updateState(rm_common::PowerLimit::CHARGE);
}
if (gimbal_cmd_sender_->getMsg()->mode == rm_msgs::GimbalCmd::RATE)
chassis_cmd_sender_->setFollowVelDes(gimbal_cmd_sender_->getMsg()->rate_yaw);
else
chassis_cmd_sender_->setFollowVelDes(0);
}

void ChassisGimbalShooterManual::rightSwitchDownRise()
Expand Down

0 comments on commit d729e97

Please sign in to comment.