35 #include <sensor_msgs/CameraInfo.h> 38 int main(
int argc,
char** argv)
43 ros::init(argc, argv,
"uvc_stereo_camera");
47 std::string
id =
"camera";
48 std::string frameId =
"camera_link";
50 pnh.
param(
"rate", rate, rate);
51 pnh.
param(
"camera_id",
id,
id);
52 pnh.
param(
"frame_id", frameId, frameId);
53 pnh.
param(
"scale", scale, scale);
77 imageLeft.
header.frame_id = frameId;
78 imageLeft.
header.stamp = currentTime;
89 sensor_msgs::CameraInfo infoLeft, infoRight;
92 infoLeft.header = imageLeft.
header;
93 infoRight.header = imageLeft.
header;
95 infoRightPub.publish(infoRight);
102 ROS_ERROR(
"Could not initialize the camera!");
static std::string homeDir()
void publish(const boost::shared_ptr< M > &message) const
std::string resolveName(const std::string &name, bool remap=true) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
Publisher advertise(const std::string &base_topic, uint32_t queue_size, bool latch=false)
const cv::Mat & imageRaw() const
static void setLevel(ULogger::Level level)
virtual bool init(const std::string &calibrationFolder=".", const std::string &cameraName="")
SensorData takeImage(CameraInfo *info=0)
const CameraModel & left() const
void publish(const sensor_msgs::Image &message) const
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
static void setType(Type type, const std::string &fileName=kDefaultLogFileName, bool append=true)
void cameraModelToROS(const rtabmap::CameraModel &model, sensor_msgs::CameraInfo &camInfo)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
int main(int argc, char **argv)
const CameraModel & right() const
const StereoCameraModel & stereoCameraModel() const
ROSCPP_DECL void spinOnce()
sensor_msgs::ImagePtr toImageMsg() const
CameraModel scaled(double scale) const