Update of /cvsroot/playerstage/code/player/client_libs/libplayerc
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32670/client_libs/libplayerc
Modified Files:
dev_simulation.c playerc.h
Log Message:
applied dalai's SIMULATION_SET_POSE3D support patches. Thanks.
Index: dev_simulation.c
===================================================================
RCS file:
/cvsroot/playerstage/code/player/client_libs/libplayerc/dev_simulation.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** dev_simulation.c 21 Sep 2006 05:07:06 -0000 1.12
--- dev_simulation.c 21 Nov 2006 02:12:34 -0000 1.13
***************
*** 141,144 ****
--- 141,190 ----
}
+ // Set the target pose in 3D
+ int playerc_simulation_set_pose3d(playerc_simulation_t *device, char* name,
double gx, double gy,
+ double gz, double groll, double gpitch,
double gyaw)
+ {
+ player_simulation_pose3d_req_t cmd;
+
+ memset(&cmd, 0, sizeof(cmd));
+ strncpy(cmd.name, name, PLAYER_SIMULATION_IDENTIFIER_MAXLEN);
+ cmd.name[PLAYER_SIMULATION_IDENTIFIER_MAXLEN-1]='\0';
+ cmd.name_count = strlen(cmd.name) + 1;
+ cmd.pose.px = gx;
+ cmd.pose.py = gy;
+ cmd.pose.pz = gz;
+ cmd.pose.ppitch = gpitch;
+ cmd.pose.proll = groll;
+ cmd.pose.pyaw = gyaw;
+
+ return playerc_client_request(device->info.client, &device->info,
+ PLAYER_SIMULATION_REQ_SET_POSE3D,
+ &cmd, NULL, 0);
+ }
+
+ // Get the current pose in 3D
+ int playerc_simulation_get_pose3d(playerc_simulation_t *device, char*
identifier,
+ double *x, double *y, double *z, double *roll, double *pitch,
double *yaw, double *time)
+ {
+ player_simulation_pose3d_req_t cfg;
+
+ memset(&cfg, 0, sizeof(cfg));
+ strncpy(cfg.name, identifier, PLAYER_SIMULATION_IDENTIFIER_MAXLEN);
+ cfg.name[PLAYER_SIMULATION_IDENTIFIER_MAXLEN-1]='\0';
+ cfg.name_count = strlen(cfg.name) + 1;
+ if (playerc_client_request(device->info.client, &device->info,
+ PLAYER_SIMULATION_REQ_GET_POSE3D,
+ &cfg, &cfg, sizeof(cfg)) < 0)
+ return (-1);
+ *x = cfg.pose.px;
+ *y = cfg.pose.py;
+ *z = cfg.pose.pz;
+ *pitch = cfg.pose.ppitch;
+ *roll = cfg.pose.proll;
+ *yaw = cfg.pose.pyaw;
+ *time = cfg.simtime;
+ return 0;
+ }
+
// Set a property value */
int playerc_simulation_set_property(playerc_simulation_t *device,
Index: playerc.h
===================================================================
RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/playerc.h,v
retrieving revision 1.215
retrieving revision 1.216
diff -C2 -d -r1.215 -r1.216
*** playerc.h 20 Nov 2006 16:53:46 -0000 1.215
--- playerc.h 21 Nov 2006 02:12:34 -0000 1.216
***************
*** 2829,2833 ****
/** @brief Get the 2D pose of a named simulation object */
int playerc_simulation_get_pose2d(playerc_simulation_t *device, char*
identifier,
! double *x, double *y, double *a);
/** @brief Set a property value */
--- 2829,2843 ----
/** @brief Get the 2D pose of a named simulation object */
int playerc_simulation_get_pose2d(playerc_simulation_t *device, char*
identifier,
! double *x, double *y, double *a);
!
! /** @brief Set the 3D pose of a named simulation object */
! int playerc_simulation_set_pose3d(playerc_simulation_t *device, char* name,
! double gx, double gy, double gz,
! double groll, double gpitch, double gyaw);
!
! /** @brief Get the 3D pose of a named simulation object */
! int playerc_simulation_get_pose3d(playerc_simulation_t *device, char*
identifier,
! double *x, double *y, double *z,
! double *roll, double *pitch, double *yaw,
double *time);
/** @brief Set a property value */
-------------------------------------------------------------------------
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