Skip to content

Commit

Permalink
Merge pull request #106 from liyixin135/follow-feedforward
Browse files Browse the repository at this point in the history
Follow feedforward
  • Loading branch information
d0h0s authored Jul 18, 2024
2 parents b62ee1e + f642aed commit de20f92
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/chassis_gimbal_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,19 @@ 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);
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 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_);
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 ChassisGimbalManual::checkReferee()
Expand Down

0 comments on commit de20f92

Please sign in to comment.