vision
YarpCropCallback.hpp
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 #ifndef __YARP_CROP_CALLBACK_HPP__
4 #define __YARP_CROP_CALLBACK_HPP__
5 
6 #include <mutex>
7 #include <utility> // std::pair
8 
9 #include <yarp/os/Bottle.h>
10 #include <yarp/os/TypedReaderCallback.h>
11 
12 #include <yarp/sig/Vector.h>
13 
14 namespace roboticslab
15 {
16 
22 class YarpCropCallback : public yarp::os::TypedReaderCallback<yarp::os::Bottle>
23 {
24 public:
25  using VertexType = std::pair<int, int>;
26 
27  void onRead(yarp::os::Bottle & bot, const yarp::os::TypedReader<yarp::os::Bottle> & reader) override;
28  yarp::sig::VectorOf<VertexType> getVertices() const;
29 
30 private:
31  yarp::sig::VectorOf<VertexType> cropVertices;
32  mutable std::mutex cropMutex;
33  bool isCropping {false};
34 };
35 
36 } // namespace roboticslab
37 
38 #endif // __YARP_CROP_CALLBACK_HPP__
Definition: YarpCropCallback.hpp:23
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:5