Hi Vijay and Josh,

2010/3/25 Vijay Pradeep <vpradeep@willowgarage.com>

What loopRate have you requested?  Could you possibly check and see how fast each loop is running?  Is it possible that the haptic processing thread is being starved (ie. is your cpu swamped)?

 I've tried with rates as low as 1Hz and nothing changes, so I don't think that's the case.

I also noticed that in the non-ROS version, your while loop is looping as fast as possible, whereas in the ROS version, it is slowed down by a loopRate object.

I'd be curious to see what happens if you remove the positionPub.publish(positionMsg) and ros:spinOnce(), and maybe also the loopRate.sleep().  Pretty much, I'm suggesting that you make your ROS-version while loop look exactly the non-ROS while loop.  This might help pin down whether or not the background ROS thread is messing things up.

Already tried this too, and it doesn't change anything either. 

2010/3/25 Josh Faust <jfaust@willowgarage.com>
 
A quick look at the HAPI API shows that enableDevice() can return an error code -- what's it returning?

It's returning 0, which corresponds to SUCCESS.

The one thing I can think of that might cause problems is if HAPI is trying to use SIGPIPE, since I believe roscpp disables it entirely.

I'm not completely sure how to find out about this. I just grep'd all HAPI source files for SIGPIPE and there are no results. I'll try to ask on their forums anyways.
 
Also, a side note: geometry_msgs/Vector3 probably fits your data better than std_msgs/Float64MultiArray.

Right now I'm using this because I want to send these messages to a Orocos node and Float64MultiArray is already defined as a valid message type. Thanks for the suggestion anyways, I'll try to look into it later.

As a side note, I'd like to add that a while ago I also tried to create a Orocos component to manage the haptic, with similar results. Maybe that can shred a light for someone.

Thanks to both of you for your suggestions, however I think I'll try to find a workaround to this, because the only way I can think of solving this is looking deep into HAPI and ROS source code, and this would require much more time than I have available right now. If you're still interested in finding what's going wrong I can do all the tests you want, though.

Best,
Miguel.


On Thu, Mar 25, 2010 at 3:38 AM, cuenta altas <miguel.register@gmail.com> wrote:
2010/3/24 Brian Gerkey <gerkey@willowgarage.com>
On Wed, Mar 24, 2010 at 9:50 AM, cuenta altas <miguel.register@gmail.com> wrote:
> I'm trying to use HAPI to create a node that manages a Novint Falcon haptic
> device.
> The problem is that haptic rendering doesn't work at all when I manage the
> device from a ROS node, while almost the same code (without all the ROS
> stuff) works fine from a standalone process.
> I know that HAPI internally spawns a separate thread to manage the device at
> high frequencies (~1 kHz). I also know that the way it does it is through
> another library (distributed with HAPI) named H3DUtil, which in turn uses
> pthreads. I suspect there must be some kind of interference between the
> thread that manages the haptic device and ROS, but I'm not comfortable
> enough with any of them (HAPI or ROS) to be able to speculate any further.
> Has anyone had any experience with this library before and experienced
> similar problems? And if nobody has, does somebody have any suggestion on
> which way should I go to try to fix this?

hi Miguel,

I'm not familiar with that library, but I'd surprised if the threads
were interfering with each other.  It's more likely that when you're
using ROS, you're not calling HAPI's event loop.  Can you post the
code that works and the code that doesn't?

Hi Brian,

These are the two files. Both compile and run okay, but with one I can feel the plane restrictions I send to the device and with the other one I can't.

I'll keep trying to figure out what's wrong.

Best,
Miguel.
 

_______________________________________________
ros-users mailing list
ros-users@code.ros.org
https://code.ros.org/mailman/listinfo/ros-users



_______________________________________________
ros-users mailing list
ros-users@code.ros.org
https://code.ros.org/mailman/listinfo/ros-users