I was able to record the [WrenchStamped](http://docs.ros.org/lunar/api/geometry_msgs/html/msg/WrenchStamped.html) data from the topic to a .bag file, export that data to a .csv file, and finally wrote a python script that uses `scipy.signal.butter()` from [here](https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.signal.butter.html) along with `scipy.signal.lfilter()` from [here](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.lfilter.html) to "post-process" the data and it worked fine (see image below).
![image description](/upfiles/15475927524274507.png)
The problem is that when I go to actually implement it in my source code (subscriber node) and run it with some hardware, I get the following error message:
Traceback (most recent call last):
File "extract_pandas1.py", line 36, in
output_fx = signal.lfilter(b, a, fx,axis=1) #Forward filter
File "/usr/lib/python2.7/dist-packages/scipy/signal/signaltools.py", line 974, in lfilter
return sigtools._linear_filter(b, a, x, axis)
ValueError: selected axis is out of range
Does anyone know what I may be doing wrong? Do you have any suggestions for another option for filtering?
Thanks in advance!!
-Cheers
↧