30 if (this->
topic(cameradata_topic_name)==
false)
107 for (
auto it = v.data.begin();
it != v.data.end();
it++)
123 float value =
float(*
p) / 1000.0;
134 for (
auto it = v.data.begin();
it != v.data.end();
it++)
199 dest.setQuantum(src.getQuantum());
200 dest.setExternal(src.getRawImage(), src.width(), src.height());
204 yarp::rosmsg::sensor_msgs::Image& dest,
205 const std::string& frame_id,
206 const yarp::rosmsg::TickTime& timeStamp,
207 const unsigned int&
seq)
210 dest.width = src.
width();
211 dest.height = src.
height();
215 dest.header.frame_id = frame_id;
216 dest.header.stamp = timeStamp;
217 dest.header.seq =
seq;
218 dest.is_bigendian = 0;
222 yarp::rosmsg::sensor_msgs::Image& dest,
223 const std::string& frame_id,
224 const yarp::rosmsg::TickTime& timeStamp,
225 const unsigned int&
seq)
229 dest.width = src.
width();
230 dest.height = src.
height();
236 dest.header.frame_id = frame_id;
237 dest.header.stamp = timeStamp;
238 dest.header.seq =
seq;
239 dest.is_bigendian = 0;
bool getFOV(double &horizontalFov, double &verticalFov) const
std::string m_camerainfo_topic_name
virtual void onRead(yarp::rosmsg::sensor_msgs::Image &v) override
DepthImage m_lastDepthImage
bool m_contains_depth_data
commonImageProcessor(std::string data_topic_name, std::string camera_info_topic_name)
yarp::os::Stamp m_lastStamp
bool getLastDepthData(yarp::sig::ImageOf< yarp::sig::PixelFloat > &data, yarp::os::Stamp &stmp)
std::string m_cameradata_topic_name
yarp::rosmsg::sensor_msgs::CameraInfo m_lastCameraInfo
bool getIntrinsicParam(yarp::os::Property &intrinsic) const
bool getLastRGBData(yarp::sig::FlexImage &data, yarp::os::Stamp &stmp)
yarp::os::Subscriber< yarp::rosmsg::sensor_msgs::CameraInfo > m_subscriber_camera_info
virtual ~commonImageProcessor()
yarp::sig::FlexImage m_lastRGBImage
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
void clear()
Remove all associations.
An abstraction for a time stamp and/or sequence number.
void update()
Set the timestamp to the current time, and increment the sequence number (wrapping to 0 if the sequen...
T * read(bool shouldWait=true)
Read a message from the port.
bool topic(const std::string &name)
Set topic to subscribe to.
Image class with user control of representation details.
void setQuantum(size_t imgQuantum)
void setPixelCode(int imgPixelCode)
int getPixelCode() const override
Gets pixel type identifier.
size_t width() const
Gets width of image in pixels.
void setExternal(const void *data, size_t imgWidth, size_t imgHeight)
Use this to wrap an external image.
size_t getRowSize() const
Size of the underlying image buffer rows.
unsigned char * getRawImage() const
Access to the internal image buffer.
size_t getRawImageSize() const
Access to the internal buffer size information (this is how much memory has been allocated for the im...
void resize(size_t imgWidth, size_t imgHeight)
Reallocate an image to be of a desired size, throwing away its current contents.
size_t getQuantum() const
The size of a row is constrained to be a multiple of the "quantum".
size_t height() const
Gets height of image in pixels.
virtual int getPixelCode() const
Gets pixel type identifier.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
void shallowCopyImages(const yarp::sig::FlexImage &src, yarp::sig::FlexImage &dest)
void deepCopyImages(const yarp::sig::FlexImage &src, yarp::rosmsg::sensor_msgs::Image &dest, const std::string &frame_id, const yarp::rosmsg::TickTime &timeStamp, const unsigned int &seq)
std::string yarp2RosPixelCode(int code)
int Ros2YarpPixelCode(const std::string &roscode)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.
The IntrinsicParams struct to handle the intrinsic parameter of cameras(RGB and RGBD either).
double focalLengthY
Result of the product of the physical focal length(mm) and the size sy of the individual imager eleme...
DistortionModel distortionModel
Distortion model of the image.
double focalLengthX
Result of the product of the physical focal length(mm) and the size sx of the individual imager eleme...
void toProperty(yarp::os::Property &intrinsic) const
toProperty, convert the struct to a Property.
double principalPointX
Horizontal coordinate of the principal point of the image, as a pixel offset from the left edge.
double principalPointY
Vertical coordinate of the principal point of the image, as a pixel offset from the top edge.