Go to the documentation of this file.
10 #include <opencv2/highgui/highgui.hpp>
22 <<
"WORLDMODEL_NAME name of the worldmodel to load, example: impuls" <<
std::endl
23 <<
"ENTITY_ID entity to fit, example dinner_table" <<
std::endl
24 <<
"RGBD_TOPIC topic on which the rgbd image is published, example /hero/head_rgbd_sensor/rgbd" <<
std::endl;
32 int main(
int argc,
char **argv)
35 ros::init(argc, argv,
"fitting_visualizer");
61 std::cerr <<
"Entity '" << entity_id <<
"' could not be found in world model '" << model_name <<
"'." <<
std::endl;
90 bool estimateEntityPose = fitter.
estimateEntityPose(fitterdata, *world_model, entity_id, e->pose(), fitted_pose);
98 cv::Mat rgbcanvas =
image->getRGBImage();
99 cv::imshow(
"RGB", rgbcanvas);
102 cv::Mat canvas =
visualizeFitting(entity_2d, sensor_pose2d, entity_pose2d, fitted_pose2d, fitterdata, estimateEntityPose);
103 cv::imshow(
"Fitting", canvas);
105 char key = cv::waitKey(30);
120 cv::destroyAllWindows();
geo::Pose3D sensor_pose_xya
bool estimateEntityPose(const FitterData &data, const ed::WorldModel &world, const ed::UUID &id, const geo::Pose3D &expected_pose, geo::Pose3D &fitted_pose, double max_yaw_change=M_PI) const
estimateEntityPose performs the entity pose estimation. Basically, tries to call estimateEntityPoseIm...
ed::WorldModelPtr loadWorldModel(const std::string &model_name)
The FitterData struct contains the downprojected (hence 2D) sensor readings as well as the sensor pos...
The EntityRepresentation2D struct contains the (downprojected) shape that is used for the fitting.
shared_ptr< const Entity > EntityConstPtr
int main(int argc, char **argv)
main executable to visualise the fitting process of live images.
EntityRepresentation2D GetOrCreateEntity2D(const ed::EntityConstPtr &e) const
GetOrCreateEntity2D returns the downprojected shape of the entity. If it's already in the cache,...
void usage()
usage, print how the executable should be used and explain the input
shared_ptr< WorldModel > WorldModelPtr
cv::Mat visualizeFitting(EntityRepresentation2D entity, geo::Transform2 sensor_pose, geo::Transform2 entity_pose, geo::Transform2 fitted_pose, FitterData fitterdata, bool estimateEntityPose)
bool waitForRecentImage(rgbd::ImageConstPtr &image, geo::Pose3D &sensor_pose, double timeout_sec, double check_rate)
void initialize(const std::string &topic, const std::string &root_frame="map", const float worker_thread_frequency=20)
void configureBeamModel(const image_geometry::PinholeCameraModel &cammodel)
configure the beam model (nr of data points and focal length) according to the camera you are using.
void processSensorData(const rgbd::Image &image, const geo::Pose3D &sensor_pose, FitterData &data) const
processSensorData pre-processes sensor data, i.e., performs a downprojection of the input depth image...
The Fitter class contains the algorithm to do the 2D fit of an entity.
const char * what() const