Update of /cvsroot/playerstage/code/player/server/drivers/mixed/erratic
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27317/server/drivers/mixed/erratic
Modified Files:
Tag: release-2-0-patches
erratic.cc
Log Message:
Index: erratic.cc
===================================================================
RCS file:
/cvsroot/playerstage/code/player/server/drivers/mixed/erratic/erratic.cc,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -C2 -d -r1.1.2.9 -r1.1.2.10
*** erratic.cc 26 Dec 2006 19:36:19 -0000 1.1.2.9
--- erratic.cc 26 Dec 2006 22:00:16 -0000 1.1.2.10
***************
*** 186,195 ****
// These get the driver in where it belongs, loading
! Driver* Erratic_Init(ConfigFile* cf, int section) {
return (Driver*)(new Erratic(cf,section));
}
! void Erratic_Register(DriverTable* table) {
table->AddDriver("erratic", Erratic_Init);
}
#if 0
extern "C" {
--- 186,199 ----
// These get the driver in where it belongs, loading
! Driver* Erratic_Init(ConfigFile* cf, int section)
! {
return (Driver*)(new Erratic(cf,section));
}
!
! void Erratic_Register(DriverTable* table)
! {
table->AddDriver("erratic", Erratic_Init);
}
+
#if 0
extern "C" {
***************
*** 206,214 ****
// Constructor of the driver from configuration entry
! Erratic::Erratic(ConfigFile* cf, int section) :
Driver(cf,section,true,PLAYER_MSGQUEUE_DEFAULT_MAXLEN) {
// zero ids, so that we'll know later which interfaces were requested
memset(&this->position_id, 0, sizeof(player_devaddr_t));
memset(&this->power_id, 0, sizeof(player_devaddr_t));
memset(&this->aio_id, 0, sizeof(player_devaddr_t));
memset(&this->last_position_cmd, 0,
sizeof(player_position2d_cmd_vel_t));
--- 210,221 ----
// Constructor of the driver from configuration entry
! Erratic::Erratic(ConfigFile* cf, int section)
! : Driver(cf,section,true,PLAYER_MSGQUEUE_DEFAULT_MAXLEN)
! {
// zero ids, so that we'll know later which interfaces were requested
memset(&this->position_id, 0, sizeof(player_devaddr_t));
memset(&this->power_id, 0, sizeof(player_devaddr_t));
memset(&this->aio_id, 0, sizeof(player_devaddr_t));
+ memset(&this->sonar_id, 0, sizeof(player_devaddr_t));
memset(&this->last_position_cmd, 0,
sizeof(player_position2d_cmd_vel_t));
***************
*** 301,308 ****
pthread_mutex_init(&motor_packet_mutex, 0);
! if (Connect()) {
! printf("Error connecting to Erratic robot\n");
! exit(1);
! }
}
--- 308,316 ----
pthread_mutex_init(&motor_packet_mutex, 0);
! if (Connect())
! {
! printf("Error connecting to Erratic robot\n");
! exit(1);
! }
}
***************
*** 314,318 ****
// Establishes connection and starts threads
! int Erratic::Connect() {
printf(" Erratic connection initializing
(%s)...",this->psos_serial_port); fflush(stdout);
--- 322,327 ----
// Establishes connection and starts threads
! int Erratic::Connect()
! {
printf(" Erratic connection initializing
(%s)...",this->psos_serial_port); fflush(stdout);
***************
*** 1299,1321 ****
}
// Request for getting sonar locations
! else if(Message::MatchMessage(hdr,PLAYER_MSGTYPE_REQ,
PLAYER_SONAR_DATA_GEOM,
! this->sonar_id)) {
! player_sonar_geom_t pose;
! pose.poses_count = RobotParams[param_idx]->NumSonars;
! for (uint16_t i = 0; i < pose.poses_count ;i++)
! pose.poses[i] = RobotParams[param_idx]->sonar_pose[i];
! this->Publish(this->sonar_id, resp_queue,
! PLAYER_MSGTYPE_RESP_ACK,
! PLAYER_SONAR_DATA_GEOM,
! (void*)&pose, sizeof(pose), NULL);
! return(0);
! }
else
! {
! PLAYER_WARN("unknown config request to erratic driver");
! return(-1);
! }
}
--- 1308,1351 ----
}
// Request for getting sonar locations
! // two types of requests...
! else if (Message::MatchMessage(hdr,PLAYER_MSGTYPE_REQ,
PLAYER_SONAR_DATA_GEOM,
! this->sonar_id))
! {
! player_sonar_geom_t pose;
! pose.poses_count = RobotParams[param_idx]->NumSonars;
! for (uint16_t i = 0; i < pose.poses_count ;i++)
! pose.poses[i] =
RobotParams[param_idx]->sonar_pose[i];
! this->Publish(this->sonar_id, resp_queue,
!
PLAYER_MSGTYPE_RESP_ACK,
!
PLAYER_SONAR_DATA_GEOM,
!
(void*)&pose, sizeof(pose), NULL);
! return(0);
! }
!
! // Request for getting sonar locations
! // two types of requests...
! else if (Message::MatchMessage(hdr,PLAYER_MSGTYPE_REQ,
! PLAYER_SONAR_REQ_GET_GEOM,
! this->sonar_id))
! {
! player_sonar_geom_t pose;
! pose.poses_count = RobotParams[param_idx]->NumSonars;
! for (uint16_t i = 0; i < pose.poses_count ;i++)
! pose.poses[i] =
RobotParams[param_idx]->sonar_pose[i];
!
! this->Publish(this->sonar_id, resp_queue,
!
PLAYER_MSGTYPE_RESP_ACK,
!
PLAYER_SONAR_REQ_GET_GEOM,
!
(void*)&pose, sizeof(pose), NULL);
! return(0);
! }
!
else
! {
! PLAYER_WARN("unknown config request to erratic driver");
! return(-1);
! }
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit