MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
moveit_pro_controllers::WrenchTareAccumulator Class Reference

#include <signal_processing.hpp>

Public Member Functions

void start (std::int64_t num_samples)
 
void reset ()
 
bool inProgress () const noexcept
 
std::optional< Eigen::Vector6d > addSample (const Eigen::Vector6d &wrench)
 

Detailed Description

Accumulates raw force/torque samples following a tare request and, once the requested number of samples has been collected, returns their average. Averaging several readings prevents a single noisy outlier from biasing the sensor offset, which would otherwise introduce drift in compliant motions.

All operations are allocation-free and lock-free, so the accumulator can be driven directly from the realtime control loop.

Member Function Documentation

◆ addSample()

std::optional< Eigen::Vector6d > moveit_pro_controllers::WrenchTareAccumulator::addSample ( const Eigen::Vector6d &  wrench)

Feeds one raw wrench sample while a tare is in progress.

Parameters
[in]wrenchthe raw force/torque measurement for this control cycle.
Returns
the averaged wrench on the call that completes the requested batch, and std::nullopt on every other call (including when no tare is in progress).

◆ inProgress()

bool moveit_pro_controllers::WrenchTareAccumulator::inProgress ( ) const
noexcept
Returns
true while a tare is in progress, i.e. start() was called and the requested batch is not yet complete.

◆ reset()

void moveit_pro_controllers::WrenchTareAccumulator::reset ( )

Cancels any in-progress tare, discarding the partial batch. Samples must come from consecutive control cycles of one control session: callers reset the accumulator on controller activation and deactivation, so a stale partial batch can never be completed with readings taken under different load or pose conditions across an inactive gap.

◆ start()

void moveit_pro_controllers::WrenchTareAccumulator::start ( std::int64_t  num_samples)

Begins a new tare. The next num_samples wrench readings passed to addSample() are averaged into the offset. Calling start() again while a tare is in progress discards the partial batch and restarts the count.

Parameters
[in]num_samplesnumber of samples to average. Values below 1 are clamped to 1.

The documentation for this class was generated from the following files: