Revision: 8144
http://playerstage.svn.sourceforge.net/playerstage/?rev=8144&view=rev
Author: gbiggs
Date: 2009-07-28 03:41:35 +0000 (Tue, 28 Jul 2009)
Log Message:
-----------
Applied patch #2824989
Modified Paths:
--------------
code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_comms.c
code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_comms.h
code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_driver.cc
Modified: code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_comms.c
===================================================================
--- code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_comms.c
2009-07-27 14:59:59 UTC (rev 8143)
+++ code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_comms.c
2009-07-28 03:41:35 UTC (rev 8144)
@@ -60,7 +60,7 @@
}
int
-roomba_open(roomba_comm_t* r, unsigned char fullcontrol)
+roomba_open(roomba_comm_t* r, unsigned char fullcontrol, int roomba500)
{
struct termios term;
int flags;
@@ -98,8 +98,17 @@
}
cfmakeraw(&term);
- cfsetispeed(&term, B57600);
- cfsetospeed(&term, B57600);
+
+ if (roomba500)
+ {
+ cfsetispeed(&term, B115200);
+ cfsetospeed(&term, B115200);
+ }
+ else
+ {
+ cfsetispeed(&term, B57600);
+ cfsetospeed(&term, B57600);
+ }
if(tcsetattr(r->fd, TCSAFLUSH, &term) < 0 )
{
Modified: code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_comms.h
===================================================================
--- code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_comms.h
2009-07-27 14:59:59 UTC (rev 8143)
+++ code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_comms.h
2009-07-28 03:41:35 UTC (rev 8144)
@@ -123,7 +123,7 @@
roomba_comm_t* roomba_create(const char* serial_port);
void roomba_destroy(roomba_comm_t* r);
-int roomba_open(roomba_comm_t* r, unsigned char fullcontrol);
+int roomba_open(roomba_comm_t* r, unsigned char fullcontrol, int roomba500);
int roomba_init(roomba_comm_t* r, unsigned char fullcontrol);
int roomba_close(roomba_comm_t* r);
int roomba_set_speeds(roomba_comm_t* r, double tv, double rv);
Modified: code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_driver.cc
===================================================================
--- code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_driver.cc
2009-07-27 14:59:59 UTC (rev 8143)
+++ code/player/trunk/server/drivers/mixed/irobot/roomba/roomba_driver.cc
2009-07-28 03:41:35 UTC (rev 8144)
@@ -80,6 +80,10 @@
- bumplock (integer)
- Default: 0
- If set to 1, the robot will stop whenever bumpers are closed
+- roomba500 (boolean)
+ - Default: false
+ - If set to true, the driver will start at the faster default baudrate
+ of the Roomba 500 series
@par Example
@@ -90,6 +94,7 @@
provides ["position2d:0" "power:0" "bumper:0" "ir:0" "opaque:0"]
port "/dev/ttyS2"
safe 1
+ roomba500 false
)
@endverbatim
@@ -144,6 +149,8 @@
bool bumplock;
bool bumplocked;
+ bool roomba500;
+
player_devaddr_t position_addr;
player_devaddr_t power_addr;
player_devaddr_t bumper_addr;
@@ -253,6 +260,7 @@
this->serial_port = cf->ReadString(section, "port", "/dev/ttyS0");
this->safe = cf->ReadInt(section, "safe", 1);
this->bumplock = cf->ReadInt(section, "bumplock", 0);
+ this->roomba500 = cf->ReadBool(section, "roomba500", 0);
this->bumplocked = false;
this->roomba_dev = NULL;
}
@@ -262,7 +270,7 @@
{
this->roomba_dev = roomba_create(this->serial_port);
- if(roomba_open(this->roomba_dev, !this->safe) < 0)
+ if(roomba_open(this->roomba_dev, !this->safe, this->roomba500) < 0)
{
roomba_destroy(this->roomba_dev);
this->roomba_dev = NULL;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit