|
31 | 31 | #include <image_transport/image_transport.h> |
32 | 32 | #include <nodelet/nodelet.h> |
33 | 33 | #include <ros/ros.h> |
| 34 | +#include <rosgraph_msgs/Clock.h> |
34 | 35 | #include <sensor_msgs/PointCloud2.h> |
35 | 36 | #include <tf2/LinearMath/Transform.h> |
36 | 37 | #include <tf2_ros/static_transform_broadcaster.h> |
@@ -117,6 +118,17 @@ class ZEDWrapperNodelet : public nodelet::Nodelet |
117 | 118 | */ |
118 | 119 | void readParameters(); |
119 | 120 |
|
| 121 | + ros::WallTimer wall_timer_; |
| 122 | + ros::Time sim_clock_base_time; |
| 123 | + /*! \brief Publish the current time when use_sim_time is true |
| 124 | + * \param t : the ros::Time to send in the clock message |
| 125 | + */ |
| 126 | + void publishSimClock(const ros::Time& stamp); |
| 127 | + |
| 128 | + /*! \brief sim clock update thread |
| 129 | + */ |
| 130 | + void sim_clock_update(const ros::WallTimerEvent& e); |
| 131 | + |
120 | 132 | /*! \brief ZED camera polling thread function |
121 | 133 | */ |
122 | 134 | void device_poll_thread_func(); |
@@ -156,7 +168,7 @@ class ZEDWrapperNodelet : public nodelet::Nodelet |
156 | 168 | /*! |
157 | 169 | * \brief Publish IMU frame once as static TF |
158 | 170 | */ |
159 | | - void publishStaticImuFrame(); |
| 171 | + void publishStaticImuFrame(const ros::Time& t); |
160 | 172 |
|
161 | 173 | /*! \brief Publish a sl::Mat image with a ros Publisher |
162 | 174 | * \param imgMsgPtr : the image message to publish |
@@ -417,6 +429,8 @@ class ZEDWrapperNodelet : public nodelet::Nodelet |
417 | 429 | image_transport::CameraPublisher mPubRightGray; |
418 | 430 | image_transport::CameraPublisher mPubRawRightGray; |
419 | 431 |
|
| 432 | + ros::Publisher mPubSimClock; |
| 433 | + |
420 | 434 | ros::Publisher mPubConfMap; // |
421 | 435 | ros::Publisher mPubDisparity; // |
422 | 436 | ros::Publisher mPubCloud; |
@@ -610,6 +624,7 @@ class ZEDWrapperNodelet : public nodelet::Nodelet |
610 | 624 | double mCamDepthResizeFactor = 1.0; |
611 | 625 |
|
612 | 626 | // flags |
| 627 | + bool mUseSimTime = false; |
613 | 628 | bool mTriggerAutoExposure = true; |
614 | 629 | bool mTriggerAutoWB = true; |
615 | 630 | bool mComputeDepth; |
|
0 commit comments