Skip to content

Commit 34e03f5

Browse files
committed
Only use target vel for feedforward and enable gravity feedforward only when hitting buff.
1 parent 440aa04 commit 34e03f5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rm_gimbal_controllers/src/gimbal_base.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ void Controller::track(const ros::Time& time)
264264
double yaw_compute = yaw_real;
265265
double pitch_compute = -pitch_real;
266266
geometry_msgs::Point target_pos = data_track_.position;
267-
geometry_msgs::Vector3 target_vel = data_track_.velocity;
267+
geometry_msgs::Vector3 target_vel{};
268+
if (data_track_.id != 12)
269+
target_vel = data_track_.velocity;
268270
try
269271
{
270272
if (!data_track_.header.frame_id.empty())
@@ -478,7 +480,8 @@ void Controller::moveJoint(const ros::Time& time, const ros::Duration& period)
478480
ctrl_pitch_.joint_.getVelocity() - angular_vel_pitch.y);
479481
ctrl_yaw_.update(time, period);
480482
ctrl_pitch_.update(time, period);
481-
// ctrl_pitch_.joint_.setCommand(ctrl_pitch_.joint_.getCommand() + feedForward(time));
483+
if (data_track_.id == 12)
484+
ctrl_pitch_.joint_.setCommand(ctrl_pitch_.joint_.getCommand() + feedForward(time));
482485
}
483486

484487
double Controller::feedForward(const ros::Time& time)

0 commit comments

Comments
 (0)