29 #include <python/BoostPythonWrapper.h> 32 #include <python/UnitWrapper.h> 33 #include <python/ImageWrapper.h> 35 namespace mira {
namespace python {
38 template<
typename Scalar,
int Channels = 1,
45 return map.map2world(p);
50 return map.map2world(p);
53 static Scalar
get(
const T &map,
int x,
int y)
58 static void set(T &map,
int x,
int y, Scalar value)
63 static boost::python::object
getMat(
const T &map)
65 return ImageAccessorBase<ImgType>::getMat(map);
67 #if BOOST_HAS_NUMPY_API 68 static void setMat(T &map,
const boost::python::numpy::ndarray& arr)
70 static void setMat(T &map,
const boost::python::numeric::array& arr)
73 ImageAccessor<ImgType>::setMat(map, arr);
77 template<
typename Scalar,
int Channels = 1,
81 using namespace boost::python;
82 class_<T> (name, init<float>())
83 .def(init<Size2i, float, Point2i>())
84 .def(
"getCellSize", &T::getCellSize)
85 .def(
"width", &T::width)
86 .def(
"height", &T::height)
87 .def(
"getOffset", &T::getOffset)
88 .def(
"getWorldOffset", &T::getWorldOffset)
89 .def(
"world2map", &T::world2mapf)
96 MIRA_PYTHONCONNECTOR_TYPE_FOOTER(T)
static boost::python::object getMat(const T &map)
Definition: GridMapWrapper.h:63
Img< Scalar, Channels > ImgType
Definition: GridMapWrapper.h:41
Definition: GridMapWrapper.h:40
static Point2f map2world(const T &map, const Point2i &p)
Definition: GridMapWrapper.h:43
static void setMat(T &map, const boost::python::numeric::array &arr)
Definition: GridMapWrapper.h:70
void registerGridMapType(const char *name)
Definition: GridMapWrapper.h:79
static Point2f map2worldf(const T &map, const Point2f &p)
Definition: GridMapWrapper.h:48