MovingFrame.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * MovingFrame.h
  3. *
  4. * Created on: Feb 10, 2009
  5. * Author: benoitbolsee
  6. */
  7. #ifndef MOVINGFRAME_HPP_
  8. #define MOVINGFRAME_HPP_
  9. #include "UncontrolledObject.hpp"
  10. #include <vector>
  11. namespace iTaSC{
  12. typedef bool (*MovingFrameCallback)(
  13. const Timestamp& timestamp,
  14. const Frame& _current,
  15. Frame& _next,
  16. void *param);
  17. class MovingFrame: public UncontrolledObject {
  18. public:
  19. MovingFrame(const Frame& frame=F_identity);
  20. virtual ~MovingFrame();
  21. bool setFrame(const Frame& frame);
  22. bool setCallback(MovingFrameCallback _function, void* _param);
  23. virtual void updateCoordinates(const Timestamp& timestamp);
  24. virtual void updateKinematics(const Timestamp& timestamp);
  25. virtual void pushCache(const Timestamp& timestamp);
  26. virtual void initCache(Cache *_cache);
  27. virtual bool finalize();
  28. protected:
  29. virtual void updateJacobian();
  30. private:
  31. void pushInternalFrame(CacheTS timestamp);
  32. bool popInternalFrame(CacheTS timestamp);
  33. MovingFrameCallback m_function;
  34. void* m_param;
  35. Frame m_nextPose;
  36. Twist m_velocity;
  37. int m_poseCCh; // cache channel for pose
  38. unsigned int m_poseCTs;
  39. };
  40. }
  41. #endif /* MOVINGFRAME_H_ */