Thanks Toby,

I'll try to put in your update as soon as I have time.

-nate

On 11/7/06, Toby Collett <[EMAIL PROTECTED]> wrote:
> Hi,
> I was about to start work on adding actarray support to gazebo when it
> suddenly arrived, excellent timing :) I have put together a few extra
> features, mainly a wx panel for controlling an actarray. Its not 100%
> but it is sufficient to get the basics done, since I will be unable to
> put time into it for the next couple of weeks I though I would post the
> patch, its attached as a diff and the new file for the panels directory.
>
> Hopefully its of use to someone, possibly there is some swig work to
> make it run a bit nicer, I had a bit of a look at it, but Im not that
> familiar with swig.
>
> Toby Collett
>
>
> Index: gui/wx/main.py
> ===================================================================
> RCS file: /cvsroot/playerstage/code/gazebo/gui/wx/main.py,v
> retrieving revision 1.17
> diff -u -r1.17 main.py
> --- gui/wx/main.py      17 Nov 2004 19:01:12 -0000      1.17
> +++ gui/wx/main.py      7 Nov 2006 08:04:23 -0000
> @@ -30,6 +30,7 @@
>  # Map from descriptive interface types to panel classes
>  panelmap = \
>  {
> +    'actarray' : gzActarray,
>      'camera' : gzCamera,
>      'gps' : gzGps,
>      'guicam' : gzGuicam,
> Index: gui/wx/panels/Makefile.am
> ===================================================================
> RCS file: /cvsroot/playerstage/code/gazebo/gui/wx/panels/Makefile.am,v
> retrieving revision 1.4
> diff -u -r1.4 Makefile.am
> --- gui/wx/panels/Makefile.am   17 Nov 2004 16:36:04 -0000      1.4
> +++ gui/wx/panels/Makefile.am   7 Nov 2006 08:04:23 -0000
> @@ -1,5 +1,5 @@
>
>
>  # Files that go in the distribution
> -EXTRA_DIST = __init__.py camera.py gps.py guicam.py laser.py position.py 
> power.py ptz.py sim.py sonar.py stereo.py
> +EXTRA_DIST = __init__.py actarray.py camera.py gps.py guicam.py laser.py 
> position.py power.py ptz.py sim.py sonar.py stereo.py
>
> Index: gui/wx/panels/__init__.py
> ===================================================================
> RCS file: /cvsroot/playerstage/code/gazebo/gui/wx/panels/__init__.py,v
> retrieving revision 1.9
> diff -u -r1.9 __init__.py
> --- gui/wx/panels/__init__.py   5 Nov 2004 08:02:33 -0000       1.9
> +++ gui/wx/panels/__init__.py   7 Nov 2006 08:04:23 -0000
> @@ -1,6 +1,7 @@
>
>  # All supported panels
>
> +from actarray import *
>  from camera import *
>  from guicam import *
>  from gps import *
> Index: libgazebo/gazebo.h
> ===================================================================
> RCS file: /cvsroot/playerstage/code/gazebo/libgazebo/gazebo.h,v
> retrieving revision 1.87
> diff -u -r1.87 gazebo.h
> --- libgazebo/gazebo.h  2 Nov 2006 17:06:31 -0000       1.87
> +++ libgazebo/gazebo.h  7 Nov 2006 08:04:26 -0000
> @@ -306,6 +306,75 @@
>  /// @}
>
>
> +/** @ingroup message_basics
> + * @defgroup utility_structs General-purpose data structures.
> + * These structures often appear inside other structures.
> + * @{ */
> +
> +/** @brief A point in the plane */
> +typedef struct gazebo_point_2d
> +{
> +  /** X [m] */
> +  float px;
> +  /** Y [m] */
> +  float py;
> +} gazebo_point_2d_t;
> +
> +
> +/** @brief A point in 3D space */
> +typedef struct gazebo_point_3d
> +{
> +  /** X [m] */
> +  float px;
> +  /** Y [m] */
> +  float py;
> +  /** Z [m] */
> +  float pz;
> +} gazebo_point_3d_t;
> +
> +
> +/** @brief An angle in 3D space */
> +typedef struct gazebo_orientation_3d
> +{
> +  /** roll [rad] */
> +  float proll;
> +  /** pitch [rad] */
> +  float ppitch;
> +  /** yaw [rad] */
> +  float pyaw;
> +} gazebo_orientation_3d_t;
> +
> +
> +/** @brief A pose in the plane */
> +typedef struct gazebo_pose
> +{
> +  /** X [m] */
> +  float px;
> +  /** Y [m] */
> +  float py;
> +  /** yaw [rad] */
> +  float pa;
> +} gazebo_pose_t;
> +
> +/** @brief A pose in space */
> +typedef struct gazebo_pose3d
> +{
> +  /** X [m] */
> +  float px;
> +  /** Y [m] */
> +  float py;
> +  /** Z [m] */
> +  float pz;
> +  /** roll [rad] */
> +  float proll;
> +  /** pitch [rad] */
> +  float ppitch;
> +  /** yaw [rad] */
> +  float pyaw;
> +} gazebo_pose3d_t;
> +
> +/** @} */
> +
>  /***************************************************************************/
>  /// @addtogroup libgazebo
>  /// @{
> @@ -1333,6 +1402,11 @@
>  /** Stalled state code */
>  #define GAZEBO_ACTARRAY_ACTSTATE_STALLED  4
>
> +/** Linear type code */
> +#define GAZEBO_ACTARRAY_TYPE_LINEAR       1
> +/** Rotary type code */
> +#define GAZEBO_ACTARRAY_TYPE_ROTARY       2
> +
>
>  /** @brief Structure containing a single actuator's information */
>  typedef struct gazebo_actarray_actuator
> @@ -1345,6 +1419,39 @@
>    uint8_t state;
>  } gazebo_actarray_actuator_t;
>
> +
> +/** @brief Actuator geometry */
> +typedef struct gazebo_actarray_actuatorgeom
> +{
> +  /** The type of the actuator - linear or rotary. */
> +  uint8_t type;
> +  /** The length of this actuator's link to the next actuator. For linear
> +  actuators, this should be its length when at 0 position. */
> +  float length;
> +  /** The orientation of this actuator when it is in its rest position. When
> +  combined with the length of the actuator's link, this will give the 
> position
> +  in space of the next actuator in the array in the coordinate space of this
> +  actuator (i.e., it is the direction to the next actuator). */
> +  gazebo_orientation_3d_t orientation;
> +  /** The axis of rotation for this actuator if it is rotary, or axis along
> +  which it moves if it is linear. In both cases, it is a vector. */
> +  gazebo_point_3d_t axis;
> +  /** The range of motion of the actuator, in m or rad depending on the 
> type. */
> +  float min;
> +  /** The range of motion of the actuator, in m or rad depending on the 
> type. */
> +  float centre;
> +  /** The range of motion of the actuator, in m or rad depending on the 
> type. */
> +  float max;
> +  /** The range of motion of the actuator, in m or rad depending on the 
> type. */
> +  float home;
> +  /** The configured speed setting of the actuator - different from current 
> speed. */
> +  float config_speed;
> +  /** If the actuator has brakes or not. */
> +  uint8_t hasbrakes;
> +} gazebo_actarray_actuatorgeom_t;
> +
> +
> +
>  //TODO: Extend this for the complete interface
>  /// Actarray interface
>  typedef struct gz_actarray_data
> @@ -1359,14 +1466,14 @@
>    unsigned int new_cmd;
>
>    /** The number of actuators in the array. */
> -  uint32_t actuators_count;
> +  unsigned int actuators_count;
>    /** The actuator data and geometry. */
>    gazebo_actarray_actuator_t actuators_data[GAZEBO_ACTARRAY_NUM_ACTUATORS];
> -  //gazebo_actarray_actuatorgeom_t 
> actuators_geom[GAZEBO_ACTARRAY_NUM_ACTUATORS];
> +  gazebo_actarray_actuatorgeom_t 
> actuators_geom[GAZEBO_ACTARRAY_NUM_ACTUATORS];
>    /** The position of the base of the actarray. */
> -  //gazebo_point_3d_t base_pos;
> +  gazebo_point_3d_t base_pos;
>    /** The orientation of the base of the actarray. */
> -  //gazebo_orientation_3d_t base_orientation;
> +  gazebo_orientation_3d_t base_orientation;
>     float cmd_pos[GAZEBO_ACTARRAY_NUM_ACTUATORS];
>     float cmd_speed[GAZEBO_ACTARRAY_NUM_ACTUATORS];
>     float cmd_current[GAZEBO_ACTARRAY_NUM_ACTUATORS];
> @@ -1419,6 +1526,12 @@
>  /// Tell clients that new data is available
>  extern int gz_actarray_post(gz_actarray_t *self);
>
> +/// Set a cmd pos value
> +extern void gz_actarray_set_cmd_pos(gz_actarray_t *self, unsigned int index, 
> double value);
> +
> +extern gazebo_actarray_actuatorgeom_t gz_actarray_get_geom(gz_actarray_t 
> *self, unsigned int index);
> +
> +extern gazebo_actarray_actuator_t gz_actarray_get_data(gz_actarray_t *self, 
> unsigned int index);
>
>  /** @} */
>  /// @}
> Index: libgazebo/gz_actarray.c
> ===================================================================
> RCS file: /cvsroot/playerstage/code/gazebo/libgazebo/gz_actarray.c,v
> retrieving revision 1.1
> diff -u -r1.1 gz_actarray.c
> --- libgazebo/gz_actarray.c     2 Nov 2006 17:06:31 -0000       1.1
> +++ libgazebo/gz_actarray.c     7 Nov 2006 08:04:26 -0000
> @@ -116,3 +116,18 @@
>  {
>    return gz_iface_post(self->iface);
>  }
> +
> +void gz_actarray_set_cmd_pos(gz_actarray_t *self, unsigned int index, double 
> value)
> +{
> +  self->data->cmd_pos[index] = value;
> +}
> +
> +gazebo_actarray_actuatorgeom_t gz_actarray_get_geom(gz_actarray_t *self, 
> unsigned int index)
> +{
> +  return self->data->actuators_geom[index];
> +}
> +
> +gazebo_actarray_actuator_t gz_actarray_get_data(gz_actarray_t *self, 
> unsigned int index)
> +{
> +  return self->data->actuators_data[index];
> +}
> Index: player/Makefile.am
> ===================================================================
> RCS file: /cvsroot/playerstage/code/gazebo/player/Makefile.am,v
> retrieving revision 1.10
> diff -u -r1.10 Makefile.am
> --- player/Makefile.am  2 Nov 2006 19:52:57 -0000       1.10
> +++ player/Makefile.am  7 Nov 2006 08:04:27 -0000
> @@ -21,7 +21,7 @@
>
>  libgazeboplugin_la_CPPFLAGS = $(AM_CPPFLAGS) @PLAYER_CFLAGS@ -I../libgazebo
>  #libgazeboplugin_la_LDFLAGS = -L../libgazebo
> -libgazeboplugin_la_LIBADD = @PLAYER_LIBS@ -lgazebo
> +libgazeboplugin_la_LIBADD = @PLAYER_LIBS@ -L../libgazebo -lgazebo
>
>  EXTRA_DIST = gazebo.cfg
>  endif
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
>
> _______________________________________________
> Playerstage-gazebo mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>
>
>
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Playerstage-gazebo mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo

Reply via email to