From: Wu H. <wu....@gm...> - 2009-03-17 09:00:18
|
Hi I am trying to get the pioneer sonar to switch on and off at certain requirements. I am using player 2.1.2 and playerc++ proxy. My code is as follows ----------------------------------------------------------------------------------- PlayerClient robot (gHostname, gPort); SonarProxy *sonarP; robot.StartThread(); for (;;) { if (onSonar) { robot.StopThread(); sonarP = new SonarProxy(&robot,0); onSonar = false; robot.StartThread(); } if (offSonar) { robot.StopThread(); delete(sonarP); offSonar = false; robot.StartThread(); } //other stuff here.... } ----------------------------------------------------------------------------------------------- The failure point comes after the delete sonar portion and when the robot thread starts to read. The error returned is *playerc warning : warning : Failed to dispatch data message: subtype 1 address: 16777343:6665:sonar:0 terminate called after throwing an instance of 'PlayerCc::PlayerError' size: 8Aborted* Any help will be well appreciated. Thanks -- Wu Hengxin Institute for Infocomm Research A*star |