31 virtual ProcessElement startElement(
const std::string& name,
const std::list<std::pair<std::string,std::string> >& atts);
32 virtual bool endElement(
const std::string& name);
33 virtual void characters(
const std::string& ch);
36 BaseXMLReaderPtr _pcurreader;
37 boost::shared_ptr<ForceSensor> _psensor;
47 virtual SensorType GetType() {
return ST_Force6D; }
50 static BaseXMLReaderPtr CreateXMLReader(InterfaceBasePtr ptr,
const std::list<std::pair<std::string,std::string> >& atts)
52 return BaseXMLReaderPtr(
new ForceSensorXMLReader(boost::dynamic_pointer_cast<ForceSensor>(ptr)));
60 virtual bool Init(
const string& args);
61 virtual void Reset(
int options);
62 virtual bool SimulationStep(OpenRAVE::dReal fTimeElapsed);
63 virtual SensorGeometryConstPtr GetSensorGeometry(SensorType type);
64 virtual SensorDataPtr CreateSensorData(SensorType type);
65 virtual bool GetSensorData(SensorDataPtr psensordata);
66 virtual void SetTransform(
const Transform& trans);
67 virtual const Transform& GetTransform();
68 bool SetHistoryLength(std::ostream& os, std::istream& is);
69 bool SetFilter(std::ostream& os, std::istream& is);
70 bool GetHistory(std::ostream& os, std::istream& is);
72 virtual bool Supports(SensorType type) {
return type == ST_Force6D; }
74 virtual int Configure(ConfigureCommand command,
bool blocking)
89 case CC_RenderDataOff: {
90 boost::mutex::scoped_lock lock(_mutexdata);
94 case CC_RenderDataCheck:
96 case CC_RenderGeometryOn:
97 _bRenderGeometry =
true;
99 case CC_RenderGeometryOff: {
100 _bRenderGeometry =
false;
103 case CC_RenderGeometryCheck:
104 return _bRenderGeometry;
106 throw openrave_exception(str(boost::format(
"SensorBase::Configure: unknown command 0x%x")%command));
115 boost::shared_ptr<Force6DSensorData> _data;
116 boost::circular_buffer<Force6DSensorData> _history;
117 boost::circular_buffer<dReal> _timestamps;
118 boost::shared_ptr<ForceSensorGeomData> _geom;
120 KinBody::LinkConstPtr _sensorLink;
122 KinBody::JointConstPtr _sensorJoint;
124 mutable boost::mutex _mutexdata;
125 bool _bRenderData, _bRenderGeometry, _bPower;
126 FilterTypes _outfilt;
127 Force6DSensorData _movingsum;
129 friend class ForceSensorXMLReader;
135 OpenRAVE::InterfaceBasePtr CreateInterface(OpenRAVE::InterfaceType type,
136 const std::string & interfacename,
137 std::istream & sinput,
138 OpenRAVE::EnvironmentBasePtr penv)
override;
140 const InterfaceMap & GetInterfaces()
const override;
141 const std::string & GetPluginName()
const override;