$search
00001 /* 00002 * Copyright (C) 2009 00003 * Robert Bosch LLC 00004 * Research and Technology Center North America 00005 * Palo Alto, California 00006 * 00007 * All rights reserved. 00008 * 00009 *------------------------------------------------------------------------------ 00010 * project ....: Autonomous Technologies 00011 * file .......: rtcPose2D.h 00012 * authors ....: Benjamin Pitzer 00013 * organization: Robert Bosch LLC 00014 * creation ...: 02/29/2008 00015 * modified ...: $Date:2008-03-03 10:26:02 -0800 (Mon, 03 Mar 2008) $ 00016 * changed by .: $Author:benjaminpitzer $ 00017 * revision ...: $Revision:141 $ 00018 */ 00019 #ifndef POSE2D_H 00020 #define POSE2D_H 00021 00022 //== INCLUDES ================================================================== 00023 #include "rtc/rtcMath.h" 00024 #include "rtc/rtcVec2.h" 00025 #include "rtc/rtcVec3.h" 00026 #include "rtc/rtcRotation2D.h" 00027 00028 //== NAMESPACES ================================================================ 00029 namespace rtc { 00030 00034 class Pose2D { 00035 public: 00036 // Constructor/Destructor 00037 Pose2D(); 00038 Pose2D(float x, float y, float theta); 00039 Pose2D(const Vec2f& translation, float rotation); 00040 Pose2D(const Vec3f& pose); 00041 ~Pose2D(); 00042 00043 // Accessors 00044 float x() const; 00045 float y() const; 00046 float theta() const; 00047 00048 Vec2f getTranslation() const; 00049 Rotation2Df getRotation() const; 00050 Transform2Df getTransform() const; 00051 00052 // adds an offset to pose 00053 void addOffset(const Vec2f& xOffset, float eOffset); 00054 00055 // Mutators 00056 void set(const Pose2D& pose); 00057 void set(float x, float y, float theta); 00058 void set(const Vec2f& translation, float rotation); 00059 void set(const Vec3f& pose); 00060 void set(const Transform2Df& transform); 00061 00062 // data 00063 Vec3f p; 00064 }; 00065 00066 // ASCII stream IO 00067 std::ostream& operator<<(std::ostream& os, const Pose2D& pose); 00068 std::istream& operator>>(std::istream& is, Pose2D& pose); 00069 00070 // binary stream IO 00071 bool rtc_write(OutputHandler& oh,const Pose2D& data); 00072 bool rtc_read(InputHandler& ih,Pose2D& data); 00073 00074 //============================================================================== 00075 } // NAMESPACE rtc 00076 //============================================================================== 00077 #endif // RTC_POSE2D_H defined 00078 //==============================================================================