9#ifndef __CAMCALIBMODULE__
10#define __CAMCALIBMODULE__
18#include <opencv2/core/core_c.h>
21#include <yarp/os/all.h>
22#include <yarp/sig/all.h>
25#include <iCub/PinholeCalibTool.h>
26#include <iCub/SphericalCalibTool.h>
27#include <iCub/CalibToolFactory.h>
28#include <iCub/ICalibTool.h>
35class CamCalibPort :
public yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> >
38 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> > *portImgOut;
51 std::map<double, yarp::os::Bottle> m_h_encs_map;
52 std::map<double, yarp::os::Bottle> m_t_encs_map;
53 std::map<double, yarp::os::Bottle> m_imu_map;
54 yarp::os::Bottle m_last_h_encs;
55 yarp::os::Bottle m_last_t_encs;
56 yarp::os::Bottle m_last_imu;
57 yarp::os::Bottle m_curr_h_encs;
58 yarp::os::Bottle m_curr_t_encs;
59 yarp::os::Bottle m_curr_imu;
65 bool updatePose(
double time);
66 bool selectBottleFromMap(
double time,
67 std::map<double, yarp::os::Bottle> *datamap,
68 yarp::os::Bottle *bottle,
69 bool verbose =
false);
70 virtual void onRead(yarp::sig::ImageOf<yarp::sig::PixelRgb> &yrpImgIn);
86 void setPointers(yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> > *_portImgOut,
ICalibTool *_calibTool);
91 void setTorsoEncoders(
double time,
const yarp::os::Bottle &t_encs) { m.lock(); m_last_t_encs = t_encs; m_t_encs_map[
time] = t_encs; m.unlock(); }
92 void setHeadEncoders(
double time,
const yarp::os::Bottle &h_encs) { m.lock(); m_last_h_encs = h_encs; m_h_encs_map[
time] = h_encs; m.unlock(); }
93 void setImuData(
double time,
const yarp::os::Bottle &imu) { m.lock(); m_last_imu = imu; m_imu_map[
time] = imu; m.unlock(); }
94 void setUseIMU(
bool useIMU) { this->useIMU = useIMU; }
95 void setUseTorso(
bool useTorso) { this->useTorso = useTorso; }
96 void setUseEyes(
bool useEyes) { this->useEyes = useEyes; }
97 void setUseLast(
bool useLast) { this->useLast = useLast; }
99 yarp::os::BufferedPort<yarp::os::Bottle>
rpyPort;
105 virtual void onRead(yarp::os::Bottle &t_encs);
112 virtual void onRead(yarp::os::Bottle &h_encs);
117class ImuPort :
public yarp::os::BufferedPort<yarp::os::Bottle> {
119 virtual void onRead(yarp::os::Bottle &imu);
138 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> > _prtImgOut;
139 yarp::os::Port _configPort;
144 std::string strGroup;
156 virtual bool respond(
const yarp::os::Bottle& command, yarp::os::Bottle& reply);
Camera Calibration Module class.
virtual bool interruptModule()
virtual double getPeriod()
virtual bool respond(const yarp::os::Bottle &command, yarp::os::Bottle &reply)
virtual bool updateModule()
virtual bool configure(yarp::os::ResourceFinder &rf)
Passes config on to CalibTool.
Camera Calibration Port class.
void setUseLast(bool useLast)
yarp::os::BufferedPort< yarp::os::Bottle > rpyPort
void setLeftEye(bool eye)
void setUseIMU(bool useIMU)
void setSaturation(double satVal)
void setTorsoEncoders(double time, const yarp::os::Bottle &t_encs)
void setUseTorso(bool useTorso)
void setImuData(double time, const yarp::os::Bottle &imu)
void setVerbose(const bool sw)
void setUseEyes(bool useEyes)
void setPointers(yarp::os::BufferedPort< yarp::sig::ImageOf< yarp::sig::PixelRgb > > *_portImgOut, ICalibTool *_calibTool)
void setHeadEncoders(double time, const yarp::os::Bottle &h_encs)
void setMaxDelay(double delay)