<P><BR>Blaise,</P><P> I tried to post this at the trac site. But I can't seem to login after registering. So I'm posting this here. Sorry everybody for the spam.</P><P>~Deepak</P><P> </P><P>I tried playing around with the modified code. I can get ::open to work on the hokuyo port by setting the O_EXLOCK flag.  Also there are some other<BR>settings that need to be changed with tcsetattr() and I've made those changes in the <BR>code below. </P><P> However, laserReadLine() hangs  when trying to read a line from the file. It seems<BR>that fgets() doesn't  work on the usb in mac.  I tried using read() instead <BR>but that  reads a fixed amount of data  from the port and does not<BR>stop on newline.</P><P> Now I'm at a loss to proceed. Any ideas? I'm not much of a driver<BR>hacker and don't really understand all the hokuyo code, so I'm not sure I can fix this myself.</P><P>What I have so far is attached.</P><P>~Deepak</P><P> </P><P> </P><P> </P><P><BR><BR><FONT SIZE=2 STYLE=font-size:9pt><B>Blaise Gassend <blaise@willowgarage.com></B></FONT><BR><FONT SIZE=2 STYLE=font-size:9pt>Sent by: ros-users-bounces@code.ros.org</FONT><BR><FONT SIZE=2 STYLE=font-size:9pt>08/19/2010 12:40 AMPlease respond toros-users@code.ros.org</FONT><BR><BR> <FONT SIZE=2 STYLE=font-size:9pt>To</FONT>   <FONT SIZE=2 STYLE=font-size:9pt>ros-users@code.ros.org</FONT><BR> <FONT SIZE=2 STYLE=font-size:9pt>cc</FONT>   <BR> <FONT SIZE=2 STYLE=font-size:9pt>bcc</FONT>   <FONT SIZE=2 STYLE=font-size:9pt>Deepak Ramachandran/HRA/ASC/HONDA</FONT><BR> <FONT SIZE=2 STYLE=font-size:9pt>Subject</FONT>   <FONT SIZE=2 STYLE=font-size:9pt>Re: [ros-users] hokuyo on mac</FONT><BR>  <BR><BR></P><P><FONT FACE="Monospace,Courier">I have replied in the trac ticket:</FONT><BR><FONT COLOR=BLUE FACE="Monospace,Courier"><U><A HREF=https://code.ros.org/trac/ros-pkg/ticket/3826>https://code.ros.org/trac/ros-pkg/ticket/3826</A></U></FONT><FONT COLOR=BLACK><BR><BR></FONT><FONT FACE="Monospace,Courier">Please try to post answers there. It makes the discussion easier to keep track of later.</FONT><BR><BR><FONT FACE="Monospace,Courier">The short of it is that I pushed a patch into trunk that looks more like Hokuyo's code, and I would be interested in having you give it a spin.</FONT><BR><BR><FONT FACE="Monospace,Courier">On Wed, Aug 18, 2010 at 8:14 PM,  <</FONT><FONT COLOR=BLUE FACE="Monospace,Courier"><U><A HREF=mailto:DRamachandran@hra.com>DRamachandran@hra.com</A></U></FONT><FONT COLOR=BLACK FACE="Monospace,Courier">> wrote:</FONT><BR><BR><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>Blaise,</B></FONT><BR><BR><BR><FONT SIZE=2 STYLE=font-size:8pt FACE="Default Sans Serif">   So I have a rudimentary version working now. I downloaded the hokuyo sample code from</FONT><BR><FONT FACE="&#39;Courier New&#39;">here:</FONT><BR><BR><FONT COLOR=BLUE FACE="&#39;Courier New&#39;"><U><A HREF=http://www.hokuyo-aut.jp/02sensor/07scanner/download/urg_programs_en/index.html>http://www.hokuyo-aut.jp/02sensor/07scanner/download/urg_programs_en/index.html</A></U></FONT><FONT COLOR=BLACK><BR><BR></FONT><FONT SIZE=2 STYLE=font-size:8pt FACE="Default Sans Serif">and adapted md_scan.c so that it outputs the data to a file which I then read from within a ros node.  Kind of hackish, but the problem was that the c++ version didn't compile on my machine (linker errors within SDL (?) ). </FONT><BR><BR><FONT SIZE=2 STYLE=font-size:8pt FACE="Default Sans Serif">I'm not sure if what I have is enough however. I guess the ros drivers do some postprocessing on the scan data before outputting, which I don't. I tried integrating with some odometry for my robot (which I know is fairly accurate) to do simple localization in AMCL and the particles jump all over the place and then the covariance blows up very fast to NaNs. Is this what you would expect with unfiltered laser data?</FONT><BR><BR><FONT FACE="&#39;Courier New&#39;">What should I do next? I can try integrating this code into the ROS hokuyo driver. It should be as simple as replacing the fopen with the setSerial code in the hokuyo sample code. I think that be best done by someone who knows what he is doing.</FONT><BR><BR><FONT FACE="&#39;Courier New&#39;">~Deepak  </FONT><BR><BR><BR><BR><BR><BR><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>No, I haven't worked on it more. Because the problem is happening on the</B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>open command, it isn't even clear that the MacOS USB driver is doing the</B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>right thing. If I were you I would look for success stories for USB</B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>Hokuyos on MacOS. They might give some useful pointers.</B></FONT><BR><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>On Wed, 2010-08-11 at 18:13 -0700, </B></FONT><FONT SIZE=6 STYLE=font-size:22pt COLOR=BLUE FACE="Default Sans Serif"><B><U><A HREF=mailto:DRamachandran@hra.com>DRamachandran@hra.com</A></U></B></FONT><FONT SIZE=6 STYLE=font-size:22pt COLOR=BLACK FACE="Default Sans Serif"><B> wrote:</B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>> Hi Blaise,</B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>> </B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>> Sorry for the 8months (!!) gap in reply. I was distracted by other</B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>> things and stopped working on this. </B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>> But now I'm planning to get back to working on this and I was</B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>> wondering a solution has been found yet ?</B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>> </B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>> cliff notes: Hokuyo not working on mac os x snow leopard, ros 1.0.0.</B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>> fopen call on hokuyo tty hanging. reason unknown. last email of</B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>> previous thread attached. </B></FONT><BR><FONT SIZE=6 STYLE=font-size:22pt FACE="Default Sans Serif"><B>> </B></FONT><BR><BR><BR><FONT FACE="Monospace,Courier">_______________________________________________</FONT><BR><FONT FACE="Monospace,Courier">ros-users mailing list</FONT><BR><FONT COLOR=BLUE FACE="Monospace,Courier"><U><A HREF=mailto:ros-users@code.ros.org>ros-users@code.ros.org</A></U></FONT><FONT COLOR=BLACK><BR></FONT><FONT COLOR=BLUE FACE="Monospace,Courier"><U><A HREF=https://code.ros.org/mailman/listinfo/ros-users>https://code.ros.org/mailman/listinfo/ros-users</A></U></FONT><FONT COLOR=BLACK><BR><BR><BR><BR></FONT><FONT FACE="Monospace,Courier">_______________________________________________<BR>ros-users mailing list<BR>ros-users@code.ros.org<BR><A HREF=https://code.ros.org/mailman/listinfo/ros-users>https://code.ros.org/mailman/listinfo/ros-users</A></FONT><BR></P>