Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Modules/MotionControl/DebugMotionControl.h

Go to the documentation of this file.

    00001 /**
    00002 * @file DebugMotionControl.h
    00003 *
    00004 * Definition of class DebugMotionControl.
    00005 *
    00006 * @author Max Risler
    00007 */
    00008
    00009 #ifndef __DebugMotionControl_h_
    00010 #define __DebugMotionControl_h_
    00011
    00012 #include "MotionStabilizer.h"
    00013 #include "MotionControl.h"
    00014 #include "Tools/Actorics/JointDataSequencer.h"
    00015
    00016 /**
    00017 * @class DebugMotionControl
    00018 *
    00019 * A MotionControl module for debugging purposes.
    00020 *
    00021 * It ignores MotionRequest but processes and executes
    00022 * JointDataSequence debug messages.
    00023 *
    00024 * @author Max Risler
    00025 */
    00026 class DebugMotionControl : public MotionControl, public MotionStabilizer
    00027 {
    00028 public:
    00029 /**
    00030 * Constructor
    00031 * @param interfaces The paramters of the MotionControl module.
    00032   */
    00033   DebugMotionControl(const MotionControlInterfaces& interfaces)
    00034     : MotionControl(interfaces),
    00035       tailcount(0)
    00036   {}
    00037
    00038   /** Executes the module */
    00039   virtual void execute();
    00040
    00041   /**
    00042   * Called from a MessageQueue to distribute messages.
    00043   * Use message.getMessageID to decide if the message is relavant for
    00044   * the MesssageHandler derivate.
    00045   * Use message.bin, message.text or message.config as In streams to get the data from.
    00046   * @param message The message that can be read.
    00047   * @return true if the message was read (handled).
    00048   */
    00049   virtual bool handleMessage(InMessage& message);
    00050
    00051 protected:
    00052
    00053   /** Counter for ticks for tail movement. */
    00054   int tailcount;
    00055
    00056   /** the JointDataSequencer */
    00057   JointDataSequencer sequencer;
    00058
    00059   /** write sensorData back to jointData for joints with invalidValue
    00060   * to disable any motion (=stay as forced)
    00061   */
    00062   void executeStayAsForced(
    00063     const SensorData& sensorData,
    00064     JointData& jointData
    00065     );
    00066
    00067   void setStayAsForcedValue(
    00068     const SensorData& sensorData,
    00069     JointData& jointData,
    00070     SensorData::sensors sensor,
    00071     JointData::JointID joint,
    00072     long tolerance
    00073     );
    00074
    00075   /** old values for stay as forced mode */
    00076   JointData stayAsForcedOldValue;
    00077
    00078   /** Clips the set joint values to allowed values */
    00079   void clip();
    00080 };
    00081
    00082 #endif// __DebugMotionControl_h_