Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add param to set actual bullet speed #65

Merged
merged 3 commits into from
Jun 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions rm_common/include/rm_common/decision/command_sender.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ class ShooterCommandSender : public TimeStampCommandSenderBase<rm_msgs::ShootCmd
{
ros::NodeHandle limit_nh(nh, "heat_limit");
heat_limit_ = new HeatLimit(limit_nh, referee_data);
nh.param("speed_10m_per_speed", speed_10_, 10.);
nh.param("speed_15m_per_speed", speed_15_, 15.);
nh.param("speed_16m_per_speed", speed_16_, 16.);
nh.param("speed_18m_per_speed", speed_18_, 18.);
nh.param("speed_30m_per_speed", speed_30_, 30.);
if (!nh.getParam("gimbal_error_tolerance", gimbal_error_tolerance_))
ROS_ERROR("gimbal error tolerance no defined (namespace: %s)", nh.getNamespace().c_str());
if (!nh.getParam("target_acceleration_tolerance", target_acceleration_tolerance_))
Expand Down Expand Up @@ -323,15 +328,15 @@ class ShooterCommandSender : public TimeStampCommandSenderBase<rm_msgs::ShootCmd
switch (msg_.speed)
{
case rm_msgs::ShootCmd::SPEED_10M_PER_SECOND:
return 10.;
return speed_10_;
case rm_msgs::ShootCmd::SPEED_15M_PER_SECOND:
return 15.;
return speed_15_;
case rm_msgs::ShootCmd::SPEED_16M_PER_SECOND:
return 16.;
return speed_16_;
case rm_msgs::ShootCmd::SPEED_18M_PER_SECOND:
return 18.;
return speed_18_;
case rm_msgs::ShootCmd::SPEED_30M_PER_SECOND:
return 30.;
return speed_30_;
}
return 0.;
}
Expand All @@ -346,6 +351,7 @@ class ShooterCommandSender : public TimeStampCommandSenderBase<rm_msgs::ShootCmd
void setZero() override{};

private:
double speed_10_, speed_15_, speed_16_, speed_18_, speed_30_;
double gimbal_error_tolerance_{};
double target_acceleration_tolerance_{};
double track_target_acceleration_;
Expand Down