⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gazebo.h

📁 机器人人3D仿真工具,可以加入到Simbad仿真环境下应用。
💻 H
📖 第 1 页 / 共 4 页
字号:
  double min_angle, max_angle;  /// Angular resolution  double res_angle;  /// Max range value  double max_range;  /// Number of range readings  int range_count;    /// Range readings  double ranges[GZ_LASER_MAX_RANGES];  /// Intensity readings  int intensity[GZ_LASER_MAX_RANGES];    // New command ( 0 or 1 )  int cmd_new_angle;  int cmd_new_length;  // Commanded range value  double cmd_max_range;  double cmd_min_angle, cmd_max_angle;  int cmd_range_count;} gz_laser_data_t;/// The laser interfacetypedef struct gz_laser{  /// General interface info  gz_iface_t *iface;  /// Pointer to interface data area  gz_laser_data_t *data;  } gz_laser_t;/// Create an interfaceextern gz_laser_t *gz_laser_alloc();/// Destroy an interfaceextern void gz_laser_free(gz_laser_t *self);/// @internal Create the interface (used by Gazebo server)extern int gz_laser_create(gz_laser_t *self, gz_server_t *server, const char *id,                           const char *model_type, int model_id, int parent_model_id);/// @internal Destroy the interface (server)extern int gz_laser_destroy(gz_laser_t *self);/// Open an existing interface (used by Gazebo clients)extern int gz_laser_open(gz_laser_t *self, gz_client_t *client, const char *id);/// Close the interface (client)extern int gz_laser_close(gz_laser_t *self);/// Lock the interface.  Set blocking to 1 if the caller should block/// until the lock is acquired.  Returns 0 if the lock is acquired.extern int gz_laser_lock(gz_laser_t *self, int blocking);/// Unlock the interfaceextern void gz_laser_unlock(gz_laser_t *self);/// Tell clients that new data is availableextern int gz_laser_post(gz_laser_t *self);/** @} *//// @}/***************************************************************************//// @addtogroup libgazebo/// @{/** @defgroup position positionThe position interface allows clients to send commands to and readodometric data from simulated mobile robot bases, such as thePioneer2AT or ATRV Jr.  This interface handles both 2D and 3D data.@{*//// Position interfacetypedef struct gz_position_data{  /// Common data structures  gz_data_t head;  /// Data timestamp  double time;  /// Pose (usually global cs); rotation is specified by euler angles  double pos[3];  double rot[3];  /// Velocity; rotation is specified by euler angles  double vel_pos[3];  double vel_rot[3];  /// Motor stall flag  int stall;  /// Enable the motors  int cmd_enable_motors;    /// Commanded robot velocities (robot cs); rotation is specified by euler angles  double cmd_vel_pos[3];  double cmd_vel_rot[3];  } gz_position_data_t;/// The position interfacetypedef struct gz_position{  /// General interface info  gz_iface_t *iface;  /// Pointer to interface data area  gz_position_data_t *data;  } gz_position_t;/// Create an interfaceextern gz_position_t *gz_position_alloc();/// Destroy an interfaceextern void gz_position_free(gz_position_t *self);/// @internal Create the interface (used by Gazebo server)extern int gz_position_create(gz_position_t *self, gz_server_t *server, const char *id,                              const char *model_type, int model_id, int parent_model_id);/// @internal Destroy the interface (server)extern int gz_position_destroy(gz_position_t *self);/// Open an existing interface (used by Gazebo clients)extern int gz_position_open(gz_position_t *self, gz_client_t *client, const char *id);/// Close the interface (client)extern int gz_position_close(gz_position_t *self);/// Lock the interface.  Set blocking to 1 if the caller should block/// until the lock is acquired.  Returns 0 if the lock is acquired.extern int gz_position_lock(gz_position_t *self, int blocking);/// Unlock the interfaceextern void gz_position_unlock(gz_position_t *self);/// Tell clients that new data is availableextern int gz_position_post(gz_position_t *self);/** @} *//// @}/***************************************************************************//// @addtogroup libgazebo/// @{/** @defgroup power powerThe power interface allows clients to read battery levels fromsimulated robots.@{*//// Power interfacetypedef struct gz_power_data{  /// Common data structures  gz_data_t head;  /// Data timestamp  double time;  /// Battery levels (volts)  double levels[10];  } gz_power_data_t;/// The power interfacetypedef struct gz_power{  /// General interface info  gz_iface_t *iface;  /// Pointer to interface data area  gz_power_data_t *data;  } gz_power_t;/// Create an interfaceextern gz_power_t *gz_power_alloc();/// Destroy an interfaceextern void gz_power_free(gz_power_t *self);/// @internal Create the interface (used by Gazebo server)extern int gz_power_create(gz_power_t *self, gz_server_t *server, const char *id,                           const char *model_type, int model_id, int parent_model_id);/// @internal Destroy the interface (server)extern int gz_power_destroy(gz_power_t *self);/// Open an existing interface (used by Gazebo clients)extern int gz_power_open(gz_power_t *self, gz_client_t *client, const char *id);/// Close the interface (client)extern int gz_power_close(gz_power_t *self);/// Lock the interface.  Set blocking to 1 if the caller should block/// until the lock is acquired.  Returns 0 if the lock is acquired.extern int gz_power_lock(gz_power_t *self, int blocking);/// Unlock the interfaceextern void gz_power_unlock(gz_power_t *self);/// Tell clients that new data is availableextern int gz_power_post(gz_power_t *self);/** @} *//// @}/***************************************************************************//// @addtogroup libgazebo/// @{/** @defgroup ptz ptzThe ptz interface allows clients to control the pan, tilt and zoomangles on a camera head such as the Sony VID30.@{*//// Ptz interfacetypedef struct gz_ptz_data{  /// Common data structure  gz_data_t head;    /// Data timestamp  double time;  /// Measured orientation (radians)  double pan, tilt;  /// Measured field of view (radians)  double zoom;  /// Commanded orientation (radians)  double cmd_pan, cmd_tilt;  /// Commanded field of view (radians)  double cmd_zoom;  } gz_ptz_data_t;/// The ptz interfacetypedef struct gz_ptz{  /// Common data structure  gz_data_t head;    /// General interface info  gz_iface_t *iface;  /// Pointer to interface data area  gz_ptz_data_t *data;  } gz_ptz_t;/// Create an interfaceextern gz_ptz_t *gz_ptz_alloc();/// Destroy an interfaceextern void gz_ptz_free(gz_ptz_t *self);/// @internal Create the interface (used by Gazebo server)extern int gz_ptz_create(gz_ptz_t *self, gz_server_t *server, const char *id,                         const char *model_type, int model_id, int parent_model_id);/// @internal Destroy the interface (server)extern int gz_ptz_destroy(gz_ptz_t *self);/// Open an existing interface (used by Gazebo clients)extern int gz_ptz_open(gz_ptz_t *self, gz_client_t *client, const char *id);/// Close the interface (client)extern int gz_ptz_close(gz_ptz_t *self);/// Lock the interface.  Set blocking to 1 if the caller should block/// until the lock is acquired.  Returns 0 if the lock is acquired.extern int gz_ptz_lock(gz_ptz_t *self, int blocking);/// Unlock the interfaceextern void gz_ptz_unlock(gz_ptz_t *self);/// Tell clients that new data is availableextern int gz_ptz_post(gz_ptz_t *self);/** @} *//// @}/***************************************************************************//// @addtogroup libgazebo/// @{/** @defgroup actarray actarrayThe actarray interface allows clients to actarray devices like robotic manipulators@{*/#define GAZEBO_ACTARRAY_NUM_ACTUATORS 16#define GAZEBO_ACTARRAY_JOINT_POSITION_MODE 0#define GAZEBO_ACTARRAY_JOINT_SPEED_MODE 1#define GAZEBO_ACTARRAY_JOINT_CURRENT_MODE 2/** Idle state code */#define GAZEBO_ACTARRAY_ACTSTATE_IDLE     1/** Moving state code */#define GAZEBO_ACTARRAY_ACTSTATE_MOVING   2/** Braked state code */#define GAZEBO_ACTARRAY_ACTSTATE_BRAKED   3/** Stalled state code */#define GAZEBO_ACTARRAY_ACTSTATE_STALLED  4/** @brief Structure containing a single actuator's information */typedef struct gazebo_actarray_actuator{  /** The position of the actuator in m or rad depending on the type. */  float position;  /** The speed of the actuator in m/s or rad/s depending on the type. */  float speed;  /** The current state of the actuator. */  uint8_t state;} gazebo_actarray_actuator_t;//TODO: Extend this for the complete interface/// Actarray interfacetypedef struct gz_actarray_data{  /// Common data structure  gz_data_t head;    /// Data timestamp  double time;    // Timestamp for commands;  unsigned int new_cmd;  /** The number of actuators in the array. */  uint32_t 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];  /** The position of the base of the actarray. */  //gazebo_point_3d_t base_pos;  /** The orientation of the base of the actarray. */  //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];   unsigned int joint_mode[GAZEBO_ACTARRAY_NUM_ACTUATORS];  //Position/Speed/Current mode} gz_actarray_data_t;/// The actarray interfacetypedef struct gz_actarray{  /// Common data structure  gz_data_t head;    /// General interface info  gz_iface_t *iface;  /// Pointer to interface data area  gz_actarray_data_t *data;  } gz_actarray_t;/// Create an interfaceextern gz_actarray_t *gz_actarray_alloc();/// Destroy an interfaceextern void gz_actarray_free(gz_actarray_t *self);/// @internal Create the interface (used by Gazebo server)extern int gz_actarray_create(gz_actarray_t *self, gz_server_t *server, const char *id,                         const char *model_type, int model_id, int parent_model_id);/// @internal Destroy the interface (server)extern int gz_actarray_destroy(gz_actarray_t *self);/// Open an existing interface (used by Gazebo clients)extern int gz_actarray_open(gz_actarray_t *self, gz_client_t *client, const char *id);/// Close the interface (client)extern int gz_actarray_close(gz_actarray_t *self);/// Lock the interface.  Set blocking to 1 if the caller should block/// until the lock is acquired.  Returns 0 if the lock is acquired.extern int gz_actarray_lock(gz_actarray_t *self, int blocking);/// Unlock the interfaceextern void gz_actarray_unlock(gz_actarray_t *self);/// Tell clients that new data is availableextern int gz_actarray_post(gz_actarray_t *self);/** @} *//// @}/***************************************************************************//// @addtogroup libgazebo/// @{/** @defgroup sonar sonarThe sonar interface allows the positions and range values for sonarsto be read.@{*/#define GZ_SONAR_MAX_RANGES 48/// Sonar data interfacetypedef struct gz_sonar_data{  /// Common data structures  gz_data_t head;  /// Data timestamp  double time;  /// Max range value  double max_range;  /// Number of sonar  int sonar_count;  /// Position of each sonar (x, y, z)  double sonar_pos[GZ_SONAR_MAX_RANGES][3];  /// Orientation of each soanr (roll, pitch, yaw)  double sonar_rot[GZ_SONAR_MAX_RANGES][3];  /// Range readings (m)  double sonar_ranges[GZ_SONAR_MAX_RANGES];    /// Enable the sonars  int cmd_enable_sonar;} gz_sonar_data_t;/// The sonar interfacetypedef struct gz_sonar{  /// General interface info  gz_iface_t *iface;  /// Pointer to interface data area  gz_sonar_data_t *data;} gz_sonar_t;/// Create an interfaceextern gz_sonar_t *gz_sonar_alloc();/// Destroy an interfaceextern void gz_sonar_free(gz_sonar_t *self);/// @internal Create the interface (used by Gazebo server)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -