Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 84

How do I implement a Low Pass filter to reduce the noise coming from a topic that is publishing a WrenchStamped msg type using a Python script?

$
0
0
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

Viewing all articles
Browse latest Browse all 84

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>