00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _ROBOT_SIMULATEDMANIPULATORDESCRIPTION_
00026 #define _ROBOT_SIMULATEDMANIPULATORDESCRIPTION_
00027
00028 #include <robot/robot>
00029
00030 #include <robot/ManipulatorDescription>
00031
00032
00033 namespace robot {
00034 namespace sim {
00035
00036
00037
00038
00039
00040
00041 class SimulatedManipulatorDescription : public ManipulatorDescription
00042 {
00043 public:
00044 SimulatedManipulatorDescription() {}
00045
00046 SimulatedManipulatorDescription(String name, Matrix4 baseTransform, KinematicChain kinematicChain)
00047 : ManipulatorDescription(name, baseTransform, kinematicChain),
00048 q(zeroVector(kinematicChain.dof())), linkGeometrySpecified(false),
00049 hasProxSensors(false), proxSensorRange(1.0) {}
00050
00051 SimulatedManipulatorDescription(const ManipulatorDescription& md)
00052 : ManipulatorDescription(md), q(zeroVector(md.getKinematicChain().dof())),
00053 linkGeometrySpecified(false), hasProxSensors(false), proxSensorRange(1.0) {}
00054
00055 SimulatedManipulatorDescription(const SimulatedManipulatorDescription& md)
00056 : ManipulatorDescription(md), q(md.q), linkGeometrySpecified(md.linkGeometrySpecified),
00057 linkRadii(md.linkRadii), hasProxSensors(hasProxSensors), proxSensorRange(proxSensorRange) {}
00058
00059 SimulatedManipulatorDescription& operator=(const SimulatedManipulatorDescription& md)
00060 {
00061 ManipulatorDescription::operator=(md);
00062 q = md.q;
00063 linkGeometrySpecified = md.linkGeometrySpecified;
00064 linkRadii = md.linkRadii;
00065 hasProxSensors = md.hasProxSensors;
00066 proxSensorRange = md.proxSensorRange;
00067 return *this;
00068 }
00069
00070 virtual String className() const { return String("SimulatedManipulatorDescription"); }
00071
00072
00073 bool operator==(const SimulatedManipulatorDescription& md)
00074 {
00075 if (&md == this) return true;
00076 return ManipulatorDescription::operator==(md);
00077 }
00078
00079 bool operator!=(const SimulatedManipulatorDescription& md) { return !(*this == md); }
00080
00081
00082
00083
00084 Vector initialConfiguration() const { return q; }
00085 bool hasGeometry() const { return linkGeometrySpecified; }
00086 array<Real> getLinkRadii() const { return linkRadii; }
00087 bool hasLinkProximitySensors() const { return hasProxSensors; }
00088 Real linkProximitySensorRange() const { return proxSensorRange; }
00089
00090
00091
00092 virtual bool formatSupported(const String format, Real version = 1.0, ExternalizationType type = IO) const
00093 { return ( (format=="xml") && (version==1.0) ); }
00094 virtual void externalize(base::Externalizer& e, String format = "", Real version = 1.0);
00095 virtual void externalize(base::Externalizer& e, String format = "", Real version = 1.0) const
00096 { Externalizable::externalize(e,format,version); }
00097
00098 protected:
00099 SimulatedManipulatorDescription(String name) : ManipulatorDescription(name) {}
00100
00101
00102 private:
00103 Vector q;
00104 bool linkGeometrySpecified;
00105 array<Real> linkRadii;
00106 bool hasProxSensors;
00107 Real proxSensorRange;
00108
00109
00110 };
00111
00112
00113 }
00114 }
00115
00116 #endif