Ask Your Question
1

Using Actionlib for publishing force data in ROS

asked 2013-01-31 18:53:25 -0600

Nishant gravatar image

Hello All!

So here is what I want to implement, in a simple list format

1) I want to have a topic which publishes data from my force sensor (serial) onto the network constantly.

2) I want to have a service, which when called, starts logging force values from the data stream being published.

3) In the case that I use multiple force sensors at once, I want to have each topic publishing and service request-response business to happen in an individual thread.

My current implementation (which simply publishes topics for all sensors in a while(ros::ok()) loop for all sensors) publishes data at about 16 Hz per force sensor, and I have a feeling it is the ROS stuff that is messing with the data output rate. I tried reading serial data off the sensors into a file without any ROS stuff in between, and then manually counted/calculated the frequency of data logging. I got an average frequency of about 55 Hz per sensor, clearly indicating that I am choking the system somewhere.

This is when I remembered a prior suggestion by Lorentz that I should use the actionlib library within ROS to achieve my above listed objectives. Is there any good tutorial on implementing actionlib server/client systems within threads, encapsulated in a class structure in C++?

Also, I am open to other suggestions with which I can increase my data rate compared to what it is now. I got frequent suggestions from my friends about using a circular queue/ buffer, also known as a ring buffer to store my data temporarily until it is read. How can I implement this buffer idea under a ROS backdrop? Any pointers in this matter would go a long way in solving this issue.

Thanks and any help is much appreciated!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-10-06 16:06:12 -0600

tfoote gravatar image

There are lots of actionlib tutorials to get you going.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-01-31 18:53:25 -0600

Seen: 270 times

Last updated: Oct 06 '14