Hi Miguel,<br><br>Just some thoughts before someone with more experience with ROS intricacies chimes in...<br><br>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)?<br>

<br>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.<br><br>I'd be curious to see what happens if you remove the <b>positionPub.publish(positionMsg)</b> and <b>ros:spinOnce()</b>, and maybe also the <b>loopRate.sleep()</b>.  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.<br>


<br>Hopefully this helps!<br><br>Vijay<br><br><div class="gmail_quote">On Thu, Mar 25, 2010 at 3:38 AM, cuenta altas <span dir="ltr"><<a href="mailto:miguel.register@gmail.com" target="_blank">miguel.register@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2010/3/24 Brian Gerkey <span dir="ltr"><<a href="mailto:gerkey@willowgarage.com" target="_blank">gerkey@willowgarage.com</a>></span><br><div class="gmail_quote"><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



<div><div></div><div>On Wed, Mar 24, 2010 at 9:50 AM, cuenta altas <<a href="mailto:miguel.register@gmail.com" target="_blank">miguel.register@gmail.com</a>> wrote:<br>
> I'm trying to use HAPI to create a node that manages a Novint Falcon haptic<br>
> device.<br>
> The problem is that haptic rendering doesn't work at all when I manage the<br>
> device from a ROS node, while almost the same code (without all the ROS<br>
> stuff) works fine from a standalone process.<br>
> I know that HAPI internally spawns a separate thread to manage the device at<br>
> high frequencies (~1 kHz). I also know that the way it does it is through<br>
> another library (distributed with HAPI) named H3DUtil, which in turn uses<br>
> pthreads. I suspect there must be some kind of interference between the<br>
> thread that manages the haptic device and ROS, but I'm not comfortable<br>
> enough with any of them (HAPI or ROS) to be able to speculate any further.<br>
> Has anyone had any experience with this library before and experienced<br>
> similar problems? And if nobody has, does somebody have any suggestion on<br>
> which way should I go to try to fix this?<br>
<br>
</div></div>hi Miguel,<br>
<br>
I'm not familiar with that library, but I'd surprised if the threads<br>
were interfering with each other.  It's more likely that when you're<br>
using ROS, you're not calling HAPI's event loop.  Can you post the<br>
code that works and the code that doesn't?<br></blockquote><div><br></div></div>Hi Brian,<br><br>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.<br>



<br>I'll keep trying to figure out what's wrong.<br><br>Best,<br>Miguel.<br><div> </div></div>
<br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br>