Encoder

HRIM defines a encoder as
A measuring device that serves to indicate the angular position of an axis, speed and acceleration of the rotor of a motor.

So, apart from the common requirements (ID, Status, Power, Specs and Simulation, detailed in HRIM component model section), all enconders will contain a topic referring to publishing movements values.

There are two types of encoders as far as coding is concerned: incremental coding and absolute coding. The difference between incremental and absolute encoders is analogous to the difference between a chronometer and a clock:

  • A chronometer measures the time of increase that elapses between its start and its end, very similar to what an increment encoder supplies a known number of impulses relative to a total of movements. If you knew the exact time when you started the clock, you can tell what time it will be later by adding the elapsed time of the timer. To control the position, adding the increment pulses to a known initial position will measure the current position.

  • When an absolute encoder is used, the current position will be constantly transmitted, just as a normal clock will tell you the exact time.
HRIM component model: Encoder
URI XML MODEL ABSTRACTION CLASS
M/O
SHORT DESCRIPTION
/hrim_sensor_encoder_<instance_id>/id generic/id.xml topic
(Pub)
M Component identification.
/hrim_sensor_encoder_<instance_id>/status generic/status.xml topic
(Pub)
M How the module is working.
/hrim_sensor_encoder_<instance_id>/power generic/power.xml topic
(Pub)
M Describes the power supply type and give the information about the module power consumption.
/hrim_sensor_encoder_<instance_id>/specs_comm generic/specs_comm.xml topic
(Pub)
M Published the capabilities in term of communicaction that the component offers.
/hrim_sensor_encoder_<instance_id>/state_comm generic/state_comm.xml topic
(Pub)
M Published the resources that the component is using at the moment.
/hrim_sensor_encoder_<instance_id>/module_3d generic/module_3d.xml topic
(Pub)
M Ask for the 3D model of the HRIM component.
/hrim_sensor_encoder_<instance_id>/module_urdf generic/module_urdf.xml topic
(Pub)
M Ask for the information of the HRIM component's 3D model.
/hrim_sensor_encoder_<instance_id>/specs sensor/encoder/topics/specs.xml topic
(Pub)
M Device features.
/hrim_sensor_encoder_<instance_id>/encoder sensor/encoder/topics/encoder.xml topic
(Pub)
M Check the position, velocity or/and acceleration of the electric motor.
/hrim_sensor_encoder_<instance_id>/reconfiguration sensor/encoder/topics/reconfiguration.xml topic
(Pub)
O Dynamic reconfiguration of H-ROS systems. The integration of an IMU sensor is needed.
Parameters
PARAMETER NAME DATA TYPE UNIT CLASS
M/O
SHORT DESCRIPTION
origin float rad M Zero/Started point.

Note: the {BASE} wildcard references the base topics all modules contain, defined in the HRIM component model page.

The XML notation would look like:

<?xml version="1.0"?>
<module name="encoder" type="sensor" description="defines the messages to interact with an encoder">
  <mandatory>

    {BASE}

    <topic name="specs" type="publish" description="device features" fileName="SpecsEncoder">
      <property name="header" type="header" fileName="Header">
        <property name="time" type="time" fileName="Time">
          <property name="sec" type="int32" unit="second">
            <value></value>
          </property>
          <property name="nanosec" type="uint32" unit="nanosecond">
            <value></value>
          </property>
        </property>
        <property name="frame_id" type="string" description="transform frame with which this data is associated">
          <value></value>
        </property>
      </property>
      <property name="encoder_type" type="uint8" unit="enum" enum='{"ENCODER_ROTARY" : 0, "ENCODER_LINEAR" : 1}'>
        <value></value>
      </property>
      <property name="encoder_information" type="uint8" unit="enum" enum='{"INCREMENTAL" : 0, "ABSOLUTE" : 1, "ABSOLUTE_MULTI_TURN" : 2}'>
        <value></value>
      </property>
      <property name="max_speed" type="int32" description="rotary encoder (rpm) // linear encoder (m)">
        <value></value>
      </property>
      <property name="max_torque" type="int32" unit="newtons per metre">
        <value></value>
      </property>
      <property name="resolution" type="int32" unit="ppr/metre" description="rotary encoder in pulses per revolution (PPR) // linear encoder (m)">
        <value></value>
      </property>
      <property name="accuracy" type="boolean" description="true: the pulses are identical / false: not identical pulses">
        <value></value>
      </property>
    </topic>

    <topic name="encoder" type="publish" description="check the position, velocity or/and acceleration of the electric motor" fileName="Encoder">
      <property name="header" type="header" fileName="Header">
        <property name="time" type="time" fileName="Time">
          <property name="sec" type="int32" unit="second">
            <value></value>
          </property>
          <property name="nanosec" type="uint32" unit="nanosecond">
            <value></value>
          </property>
        </property>
        <property name="frame_id" type="string" description="transform frame with which this data is associated">
          <value></value>
        </property>
      </property>
      <property name="moving" type="boolean" description="whether the motor is currently in motion">
        <value></value>
      </property>
      <property name="encoder" type="uint8">
        <value></value>
      </property>
      <property name="encoder_type" type="uint8">
        <value></value>
      </property>
      <property name="encoder_output" type="uint8">
        <value></value>
      </property>
      <property name="goal_position" type="int32" unit="radian" description="commanded position">
        <value></value>
      </property>
      <property name="current_position" type="int32" unit="radian" description="current position">
        <value></value>
      </property>
      <property name="error_position" type="int32" unit="radian" description="difference between current and goal positions">
        <value></value>
      </property>
      <property name="goal_speed" type="int32" unit="rpm" description="commanded position">
        <value></value>
      </property>
      <property name="current_speed" type="int32" unit="rpm" description="current position">
        <value></value>
      </property>
      <property name="error_speed" type="int32" unit="rpm" description="difference between current and goal speed">
        <value></value>
      </property>
      <property name="goal_acceleration" type="int32" unit="rpm squared" description="commanded position">
        <value></value>
      </property>
      <property name="current_acceleration" type="int32" unit="rpm squared" description="current position">
        <value></value>
      </property>
      <property name="error_acceleration" type="int32" unit="rpm squared" description="difference between current and goal acceleration">
        <value></value>
      </property>
    </topic>

    <param name="origin" type="float" unit="radian" description="zero/started point">
      <value></value>
    </param>

  </mandatory>
  <optional>

    <topic name="reconfiguration" type="publish" description="dynamic reconfiguration of H-ROS systems" fileName="Reconfiguration">
      <property name="header" type="header" fileName="Header">
        <property name="time" type="time" fileName="Time">
          <property name="sec" type="int32" unit="second">
            <value></value>
          </property>
          <property name="nanosec" type="uint32" unit="nanosecond">
            <value></value>
          </property>
        </property>
        <property name="frame_id" type="string" description="transform frame with which this data is associated">
          <value></value>
        </property>
      </property>
      <property name="orientation" type="quaternion" fileName="Quaternion">
        <property name="x" type="float64">
          <value></value>
        </property>
        <property name="y" type="float64">
          <value></value>
        </property>
        <property name="z" type="float64">
          <value></value>
        </property>
        <property name="w" type="float64">
          <value></value>
        </property>
      </property>
      <property name="orientation_covariance" type="float64[9]">
        <value></value>
      </property>
      <property name="angular_velocity" type="vector3" fileName="Vector3">
        <property name="x" type="float64">
          <value></value>
        </property>
        <property name="y" type="float64">
          <value></value>
        </property>
        <property name="z" type="float64">
          <value></value>
        </property>
      </property>
      <property name="angular_velocity_covariance" type="float64[9]">
        <value></value>
      </property>
      <property name="linear_acceleration" type="vector3" fileName="Vector3">
        <property name="x" type="float64">
          <value></value>
        </property>
        <property name="y" type="float64">
          <value></value>
        </property>
        <property name="z" type="float64">
          <value></value>
        </property>
      </property>
      <property name="linear_acceleration_covariance" type="float64[9]">
        <value></value>
      </property>
    </topic>

  </optional>
</module>