Fixed Moving average for acorn approach
This commit is contained in:
@@ -53,7 +53,7 @@ protected:
|
||||
rclcpp::Subscription<PoseStamped>::SharedPtr acorn_pose_sub_;
|
||||
rclcpp_lifecycle::LifecyclePublisher<visualization_msgs::msg::Marker>::SharedPtr target_pose_pub_;
|
||||
std::shared_mutex mutex_;
|
||||
RollingAverage avg_ = RollingAverage(5);
|
||||
RollingAverage avg_ = RollingAverage(10);
|
||||
|
||||
//Goal
|
||||
geometry_msgs::msg::Pose new_target_pose_;
|
||||
|
||||
@@ -18,10 +18,10 @@ public:
|
||||
|
||||
Pose2D push(geometry_msgs::msg::Pose & pose)
|
||||
{
|
||||
if(size_ > 0) {
|
||||
if(size_ == 0) {
|
||||
return {};
|
||||
}
|
||||
if (size_ == data_count_) {
|
||||
if (size_-1 == data_count_) {
|
||||
accum_x_ -= poses_[front_idx_].position.x;
|
||||
accum_y_ -= poses_[front_idx_].position.y;
|
||||
accum_theta_ -= tf2::getYaw(poses_[front_idx_].orientation);
|
||||
|
||||
Reference in New Issue
Block a user