snark
laser_map.h
1 // This file is part of snark, a generic and flexible library
2 // for robotics research.
3 //
4 // Copyright (C) 2011 The University of Sydney
5 //
6 // snark is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 3 of the License, or (at your option) any later version.
10 //
11 // snark is distributed in the hope that it will be useful, but WITHOUT ANY
12 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14 // for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with snark. If not, see <http://www.gnu.org/licenses/>.
18 
19 #include <boost/array.hpp>
20 #include <snark/sensors/velodyne/db.h>
21 
22 namespace snark { namespace velodyne {
23 
25 class laser_map
26 {
27  public:
29  laser_map( const snark::velodyne::db& db );
30 
32  unsigned int id_to_index( unsigned int i ) const;
33 
35  unsigned int operator[]( unsigned int i ) const;
36 
38  unsigned int index_to_id( unsigned int i ) const;
39 
40  private:
41  boost::array< unsigned int, 64 > indices_;
42  boost::array< unsigned int, 64 > ids_;
43 };
44 
45 } } // namespace snark { namespace velodyne {
46