42 #ifndef IIROB_FILTERS_THRESHOLD_FILTER_H 43 #define IIROB_FILTERS_THRESHOLD_FILTER_H 46 #include <geometry_msgs/WrenchStamped.h> 47 #include <iirob_filters/ThresholdParameters.h> 48 #include <iirob_filters/ThresholdConfig.h> 49 #include <dynamic_reconfigure/server.h> 61 virtual bool update(
const T & data_in, T& data_out);
64 iirob_filters::ThresholdParameters
params_;
94 ROS_ERROR(
"ThresholdFilter did not find param linear_threshold");
96 ROS_ERROR(
"ThresholdFilter did not find param angular_threshold");
98 ROS_INFO(
"Threshhold Filter Params: Threshold: %f; Treshold lin.: %f; Threshold Anglular: %f" ,
104 template <
typename T>
110 double sign = (data_in > 0) ? 1 : -1;
123 double sign = (data_in.wrench.force.x > 0) ? 1 : -1;
124 data_out.wrench.force.x = data_in.wrench.force.x-
threshold_lin_*sign;
128 data_out.wrench.force.x = 0;
132 double sign = (data_in.wrench.force.y > 0) ? 1 : -1;
133 data_out.wrench.force.y = data_in.wrench.force.y-
threshold_lin_*sign;
137 data_out.wrench.force.y = 0;
141 double sign = (data_in.wrench.force.z > 0) ? 1 : -1;
142 data_out.wrench.force.z = data_in.wrench.force.z-
threshold_lin_*sign;
146 data_out.wrench.force.z = 0;
150 double sign = (data_in.wrench.torque.x > 0) ? 1 : -1;
155 data_out.wrench.torque.x = 0;
159 double sign = (data_in.wrench.force.y > 0) ? 1 : -1;
164 data_out.wrench.torque.y = 0;
168 double sign = (data_in.wrench.torque.z > 0) ? 1 : -1;
173 data_out.wrench.torque.z = 0;
178 template <
typename T>
187 template <
typename T>
195 virtual bool update(
const std::vector<T>& data_in, std::vector<T>& data_out);
208 template <
typename T>
213 template <
typename T>
219 template <
typename T>
227 ROS_ERROR(
"ThresholdFilter did not find param linear_threshold");
229 ROS_ERROR(
"ThresholdFilter did not find param angular_threshold");
234 template <
typename T>
245 for(
int i = 0; i < data_in.size(); i++)
247 data_out[i] = data_in[i];
249 double sign = (data_in[i] > 0) ? 1 : -1;
dynamic_reconfigure::Server< iirob_filters::ThresholdConfig > reconfigCalibrationSrv_
void reconfigureConfigurationRequest(iirob_filters::ThresholdConfig &config, uint32_t level)
~MultiChannelThresholdFilter()
MultiChannelThresholdFilter()
iirob_filters::ThresholdParameters params_
unsigned int number_of_channels_
iirob_filters::ThresholdParameters params_
double threshold_angular_
virtual bool update(const std::vector< T > &data_in, std::vector< T > &data_out)
double threshold_angular_
virtual bool update(const T &data_in, T &data_out)