- 作者
- Rosen Diankov
Shows how to toggle sensor power and rendering options
Camera Sensor.
Laser Sensor.
Full Example Code:
#include <vector>
using namespace OpenRAVE;
using namespace std;
namespace cppexamples {
class ShowSensorsExample : public OpenRAVEExample
{
public:
virtual void demothread(int argc, char ** argv) {
penv->Load("data/testwamcamera.env.xml");
size_t ienablesensor = 0;
std::vector<SensorBasePtr> sensors;
penv->GetSensors(sensors);
while(IsOk()) {
for(size_t isensor = 0; isensor < sensors.size(); ++isensor) {
}
ienablesensor = (ienablesensor+1)%sensors.size();
boost::this_thread::sleep(boost::posix_time::seconds(5));
}
}
};
}
int main(
int argc,
char ** argv)
{
return example.
main(argc,argv);
}