8 #include <raspicam/raspicam_cv.h> 9 #include <image_transport/image_transport.h> 10 #include <cv_bridge/cv_bridge.h> 12 #include <opencv2/highgui/highgui.hpp> 14 int main(
int argc,
char **argv) {
16 raspicam::RaspiCam_Cv Camera;
20 const char *WIN_NAME =
"Test Window";
23 ros::init(argc, argv,
"raspicam_publisher");
25 image_transpor::ImageTransport it(node_obj);
26 image_transport::Publisher pub = it.advertise(
"camera/image", 1);
30 sensor_msgs::ImagePtr msg;
33 Camera.set(CV_CAP_PROP_FRAME_WIDTH, 640);
34 Camera.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
48 while (node_obj.
ok()) {
51 Camera.retrieve(cv_image);
54 msg = cv_bridge::CvImage(std_msgs::Header(),
"bgr8", cv_image).toImageMsg();
58 c = (char) cvWaitKey(delay);
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
ROSCPP_DECL void spinOnce()