New command for position2d interface?

Jorge Santos Simón <[email protected]>
Newsgroups gmane.science.robotics.playerstage
Message-ID <[email protected]>
Hello all,

I propose you to include a new command for the position2d interface
that I guest a bunch of drivers can easily implement:

An stop command followed by a byte signalling the type of stop. My
controller accepts three types of stops:
 - cutting power to motors (very, very radical)
 - abrupt stop, for emergency cases
 - smooth stop (in some drivers this can be the same that setting speed to 0)

But of course the exact meaning of this byte will be very driver specific.

What do you think? Can it be useful for someone apart of me? I have
attached the modified .def file and a patch.


By the way, I wanted to define an enum type like the following one:

/** Stop type: enumeration that defines the emergency level of the stop */
typedef enum player_position2d_stop_type
{
  STOP_PWROFF,   /** Cut motor power supply (only for very extreme cases) */
  STOP_ABRUPT,    /** Stop as fast as possible */
  STOP_SMOOTH    /** Stop in a safe way (should be faster than setting
speed to zero) */
} player_position2d_stop_type_t;

but then player cannot compile if I try to use this type on my
player_position2d_stop_cmd_t structure.
Is it possible to define enums on interfaces?

Best regards,
Jorge

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo

_______________________________________________
Playerstage-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-developers
004_position2d.def (application/octet-stream, 9 KB) - not displayed
004_position2d.patch (application/octet-stream, 1.2 KB)
Index: 004_position2d.def
===================================================================
--- 004_position2d.def	(revision 8769)
+++ 004_position2d.def	(working copy)
@@ -56,6 +56,13 @@
   double angle;
 } player_position2d_cmd_vel_head_t;
 
+/** stop command: stop type depending on the emergency level */
+typedef struct player_position2d_cmd_stop
+{
+  /** stop type: power off (0), abrupt (1) or smooth (2) */
+  uint8_t type;
+} player_position2d_cmd_stop_t;
+
 /** position2d geom */
 typedef struct player_position2d_geom
 {
@@ -246,8 +253,12 @@
   for the robot's motors (only supported by some drivers). */
   message { CMD, CAR, 3, player_position2d_cmd_car_t };
 
-
   /** @brief Command: vel/head (@ref PLAYER_POSITION2D_CMD_VEL_HEAD)
 
   The @p position interface accepts translational velocity + absolute heading commands (speed and angular position) for the robot's motors (only supported by some drivers). */
   message { CMD, VEL_HEAD , 4, player_position2d_cmd_vel_head_t };
+
+  /** @brief Command: stop (@ref PLAYER_POSITION2D_CMD_STOP)
+
+  The @p position interface accepts stop commands with increasing emergency level (experimental command, non supported by most drivers). */
+  message { CMD, STOP , 5, player_position2d_cmd_stop_t };
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.