The BUMPSTALL code appears to work on the robot. By work, I mean that when I try and move the robot with playerv I no longer recieve a warning that the bumpers are engaged. However, I still cannot make the wheels move. There is no longer a velocity thresholded error, but the wheels won't turn.
The motors appear to be enabled since the status light is blinking fast. And sometimes they appear to move slightly. This is happening on two bots and they both work in the Activmedia environment. It still appears to be a sw issue and not hw related.
Has anyone else used player-stage on a p3at-sh? Maybe I should post this question to the list. If someone else got theirs running, perhaps I can dialogue with them.
Brian Gerkey <gerkey@...> wrote:
stephen reiman wrote:
> Please let me know what I need to add to the current player code to
> include BUMPSTALL.
I've just added to the p2os driver the ability to change the bumpstall
behavior from the player config file. Note that this is untested code
(I don't have any bumper-equipped robots handy), and as such may cause
your robot to catch fire. Please let me know how it works.
If you're working from CVS, update then make.
Alternatively, you can use the attached patch, which is against player
1.6.1 (it should also work with 1.6). To apply the patch, save it
somewhere, such as /tmp, then:
$ cd player-1.6.1
$ patch -p0 < /tmp/p2os-bumpstall.patch
In either case, to try it, use the 'bumpstall' option to the p2os
Allowed values for bumpstall are:
-1 (default): Don't change anything; the bumper-stall behavior will
be determined by the BumpStall value stored in the
0 : Don't stall.
1 : Stall on front bumper contact.
2 : Stall on rear bumper contact.
3 : Stall on either bumper contact.
Brian P. Gerkey gerkey@...
Stanford AI Lab http://ai.stanford.edu/~gerkey
diff -c server/drivers/mixed/p2os/p2os.cc /home/gerkey/code/player/server/drivers/mixed/p2os/p2os.cc
*** server/drivers/mixed/p2os/p2os.cc Wed Nov 17 14:00:27 2004
--- /home/gerkey/code/player/server/drivers/mixed/p2os/p2os.cc Wed Jan 26 10:03:35 2005
*** 109,114 ****
--- 109,125 ----
- radio (integer)
- Default: 0
- Nonzero if a radio modem is being used; zero for a direct serial link.
+ - bumpstall (integer)
+ - Default: -1
+ - Determine whether a bumper-equipped robot stalls when its bumpers are
+ pressed. Allowed values are:
+ - -1 : Don't change anything; the bumper-stall behavior will
+ be determined by the BumpStall value stored in the robot's
+ - 0 : Don't stall.
+ - 1 : Stall on front bumper contact.
+ - 2 : Stall on rear bumper contact.
+ - 3 : Stall on either bumper contact.
- joystick (integer)
- Default: 0
- Use direct joystick control
*** 351,356 ****
--- 362,368 ----
// Read config file options
+ this->bumpstall = cf->ReadInt(section,"bumpstall",-1);
this->psos_serial_port = cf->ReadString(section,"port",DEFAULT_P2OS_PORT);
this->radio_modemp = cf->ReadInt(section, "radio", 0);
this->joystickp = cf->ReadInt(section, "joystick", 0);
*** 739,744 ****
--- 751,781 ----
+ // if requested, change bumper-stall behavior
+ // 0 = don't stall
+ // 1 = stall on front bumper contact
+ // 2 = stall on rear bumper contact
+ // 3 = stall on either bumper contact
+ if(this->bumpstall >= 0)
+ if(this->bumpstall > 3)
+ PLAYER_ERROR1("ignoring bumpstall value %d; should be 0, 1, 2, or 3",
+ PLAYER_MSG1(1, "setting bumpstall to %d", this->bumpstall);
+ P2OSPacket bumpstall_packet;;
+ unsigned char bumpstall_command;
+ bumpstall_command = BUMP_STALL;
+ bumpstall_command = ARGINT;
+ bumpstall_command = (unsigned char)this->bumpstall;
+ bumpstall_command = 0;
+ bumpstall_packet.Build(bumpstall_command, 4);
// zero position command buffer
diff -c server/drivers/mixed/p2os/p2os.h /home/gerkey/code/player/server/drivers/mixed/p2os/p2os.h
*** server/drivers/mixed/p2os/p2os.h Wed Nov 10 17:39:33 2004
--- /home/gerkey/code/player/server/drivers/mixed/p2os/p2os.h Wed Jan 26 09:43:52 2005
*** 76,81 ****
--- 76,82 ----
#define GRIPPERVAL 36
#define TTY2 42 // Added in AmigOS 1.2
#define GETAUX 43 // Added in AmigOS 1.2
+ #define BUMP_STALL 44
#define JOYDRIVE 47
#define GYRO 58 // Added in AROS 1.8
#define TTY3 66 // Added in AmigOS 1.3
*** 198,203 ****
--- 199,205 ----
int radio_modemp; // are we using a radio modem?
int joystickp; // are we using a joystick?
+ int bumpstall; // should we change the bumper-stall behavior?
Do you Yahoo!?
Yahoo! Search presents - Jib Jab's 'Second Term'