20 #include <std_msgs/Float64.h> 37 void input_cb(
const std_msgs::Float64::ConstPtr& input)
39 std_msgs::Float64 output;
41 ma_->addElement(input->data);
42 if (
ma_->calcMovingAverage(output.data))
57 int main(
int argc,
char **argv)
59 ros::init(argc, argv,
"test_moving_average_node");
ros::Publisher output_pub_
MovingAverageExponential< double > MovingAvgExponential_double_t
MovingAverageWeighted< double > MovingAvgWeighted_double_t
void publish(const boost::shared_ptr< M > &message) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ros::Subscriber input_sub_
void input_cb(const std_msgs::Float64::ConstPtr &input)
ROSCPP_DECL void spin(Spinner &spinner)
boost::shared_ptr< MovingAvgBase_double_t > ma_
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
int main(int argc, char **argv)
MovingAverageTester(std::string out, MovingAvgBase_double_t *ma)
MovingAverageSimple< double > MovingAvgSimple_double_t