Good point. done.


On Fri, May 30, 2014 at 1:45 AM, G.A. vd. Hoorn <notifications@github.com>
wrote:

> In industrial_trajectory_filters/src/add_smoothing_filter.cpp:
>
> > +    // see if a new set of filter parameters is on the parameter server, if so, install them
> > +    if (!nh_.getParam(FILTER_PARAMETER_NAME_, filter_base_name_)){
> > +      ROS_INFO_STREAM("Param '" << FILTER_PARAMETER_NAME_ << "' was not set. Using default filter values " );
> > +    }
> > +    else{ // base filter name exists
> > +      std::string filter_order_param = filter_base_name_ + "/num_coeficients";
> > +      if(!nh_.getParam(filter_order_param, num_coef)){
> > +	ROS_INFO_STREAM("Param '" << filter_order_param << "' was not set. Using default filter values " );
> > +      }
> > +      else{ // num_coef exists for this base name
> > +	if(num_coef %2 == 0){
> > +	  ROS_ERROR("Smoothing filters must have odd number of coeficients");
> > +	}
> > +	else{
> > +	  std::vector<double> temp_coef;
> > +	  for(int i=0; i<num_coef; i++){
>
> Could you perhaps use ros::NodeHandle::getParam<std::vector<T>> (see Parameter
> Server#Retrieving_Lists
> <http://wiki.ros.org/roscpp/Overview/Parameter%20Server#Retrieving_Lists>)?
> Would remove the need for the for loop.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ros-industrial/industrial_core/pull/77/files#r13218337>
> .
>