yiyuting1991 / brown-ros-pkg

Automatically exported from code.google.com/p/brown-ros-pkg
0 stars 0 forks source link

irobot_create_2_1: /odom (z and w) and /sensorPacket (distance and angle) returning nonsense #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I'm trying to get the irobot_create_2_1 working "out of the box" with my iRobot 
Create.  I've hooked up the iRobot to a serial port (/dev/ttyUSB0) via a 
serial-to-USB converter.  I'm able to start the irobot_create_2_1 package 
successfully with the .launch file.  (Incidentally, the test .launch file was 
missing a name attribute for the node; accordingly, I updated that line to 
reflect:  <node pkg="irobot_create" type="driver" output="screen"/>.)

When I listen on the /odom and /sensorPacket topics, they are publishing 
successfully but the /odom messages' position x, position y, orientation z, 
orientation w, and linear x are returning seemingly random numbers on every 
publication.  Likewise, the /sensorPacket messages' distance and angle are also 
returning random numbers and the bumpers, cliffs and other sensors don't appear 
to be changing at all to any resulting physical interaction with the Create.

Finally, the /tank and other services are returning true as a confirmation, but 
aren't making the Create do anything.  The /reset service is the only thing 
which seems to do anything for me; it simply makes /odom and /sensorPacket stop 
publishing.

Any tips would be much appreciated!

Thanks very much!!
Billy McCafferty
http://www.sharprobotica.com

Original issue reported on code.google.com by wmccaffe...@gmail.com on 26 Oct 2010 at 5:35

GoogleCodeExporter commented 9 years ago
As a quick clarification; I did make one change to the code.  I changed the 
code to connect on /dev/ttyUSB0 which it appears to do successfully when I 
launch the package.

Original comment by wmccaffe...@gmail.com on 26 Oct 2010 at 5:38

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Might I need to change the baud rate in Ubuntu?  E.g., "stty -F /dev/ttyUSB0 
speed 57600" ... or something more complete like "stty -F /dev/ttyS0 57600 raw 
-parenb -parodd cs8 -hupcl -cstopb clocal"

I'm away from my Create at the moment, but I'll try this later this evening if 
I don't hear otherwise before then.

Original comment by wmccaffe...@gmail.com on 26 Oct 2010 at 7:27

GoogleCodeExporter commented 9 years ago
I see that 
http://brown-ros-pkg.googlecode.com/svn/tags/brown-ros-pkg/irobot_create_2_1/bin
/irobot/create.py already sets the baud to 57600 and along with the other 
serial connection settings.  Do you have any other ideas for the behavior that 
I'm seeing?

Original comment by wmccaffe...@gmail.com on 26 Oct 2010 at 9:33

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Sorry you're having trouble. A few questions that might help us sort everything 
out:

1) What version of ROS are you using? There were a number of new versions 
released in the last couple of days and we haven't had a chance to test them 
all so far.
2) Does your Create play a song when you start up the driver node? 
3) Have you tried using our stock driver and using:
 rosparam set /brown/irobot_create_2_1/port "/dev/ttyUSB0"
to change the port instead of changing the code itself?
4) What kind of result do you get when you try attaching a serial terminal 
(e.g. minicom) to the robot when ROS isn't running.

You're right about the baud rate being set by the driver, so I don't suspect 
that's the problem. It does seem like a connectivity issue though.

Original comment by trevor...@gmail.com on 26 Oct 2010 at 11:30

GoogleCodeExporter commented 9 years ago
Thanks for the quick response!  I *think* the problem is my RS232-to-USB 
adapter...I've verified that I'm also having problems connecting to my SICK via 
the same cable.  Will try my docking station which has a native COM port and 
let you know how that goes.

Original comment by wmccaffe...@gmail.com on 27 Oct 2010 at 3:54

GoogleCodeExporter commented 9 years ago
Sure enough, it was the RS232-USB adapter cable.  I got a replacement this 
morning and it works like a champ.  I'm very impressed by your Create node; I 
especially appreciate the fact that only has a single non-ROS 
dependency...great work!

Billy McCafferty
http://www.sharprobotica.com

Original comment by wmccaffe...@gmail.com on 28 Oct 2010 at 4:26

GoogleCodeExporter commented 9 years ago
The kind words are very appreciated. Let us know if there's anything else we 
can do to help.

Original comment by trevor...@gmail.com on 29 Oct 2010 at 12:30