19 #ifndef SNARK_SENSORS_VELODYNE_THIN_FOCUS
20 #define SNARK_SENSORS_VELODYNE_THIN_FOCUS
23 #include <boost/shared_ptr.hpp>
26 namespace snark {
namespace velodyne {
namespace thin {
32 focus(
double rate = 1.0,
double ratio = 1.0 );
33 template <
typename Random >
34 bool has(
double range,
double bearing,
double elevation, Random& random )
const;
35 double rate_in_focus()
const;
36 double rate_out_of_focus()
const;
37 double coverage()
const;
38 void insert( std::size_t
id,
region* r );
39 void erase( std::size_t
id );
42 typedef std::map< std::size_t, boost::shared_ptr< region > > Map;
46 double m_rate_in_focus;
47 double m_rate_out_of_focus;
51 template <
typename Random >
52 bool focus::has(
double range,
double bearing,
double elevation, Random& random )
const
55 for(
typename Map::const_iterator it = m_regions.begin(); it != m_regions.end(); ++it )
57 if( it->second->has( range, bearing, elevation ) ) {
return r < m_rate_in_focus; }
59 return r < m_rate_out_of_focus;
64 #endif // #ifndev SNARK_SENSORS_VELODYNE_THIN_FOCUS