2 #include <gtest/gtest.h> 5 #include "geometry_msgs/PoseStamped.h" 6 #include "nav_msgs/Odometry.h" 8 #include "sensor_msgs/PointCloud2.h" 9 #include "sensor_msgs/TimeReference.h" 10 #include "tf2_msgs/TFMessage.h" 18 #include "outsight_alb_driver/AugmentedCloud.h" 19 #include "outsight_alb_driver/TrackedObjects.h" 54 private_node.
param<std::string>(key, filename,
"");
57 file = fopen(filename.c_str(),
"r");
80 template <
typename ROSMessageType>
84 topic, 1000, &AlbPublisherTest::onMessageReceived<ROSMessageType>,
this);
88 template <
typename ROSMessageType>
98 Tlv::tlv_s *read_tlv =
nullptr;
102 albPublisher.
publish(read_tlv);
270 subscribeTo<tf2_msgs::TFMessage>(
"tf");
278 int main(
int argc,
char **argv)
280 testing::InitGoogleTest(&argc, argv);
281 ros::init(argc, argv,
"outsight_publishers_test");
282 return RUN_ALL_TESTS();
constexpr const char * k_alb_tracking_file
void removeParameters()
Remove all the test parameters.
constexpr const size_t k_tracking_messages
constexpr const char * k_alb_egomotion_config
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
Class to publish ROS messages from the ALB.
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ros::Subscriber alb_subscriber
uint32_t getNumPublishers() const
constexpr const char * k_alb_point_cloud_config
bool deleteParam(const std::string &key) const
constexpr const char * k_alb_odometry_config
constexpr const char * k_alb_pose_config
constexpr const char * k_alb_egomotion
constexpr const char * k_alb_objects_config
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
constexpr const char * k_alb_broadcast_tf_config
void openFile(const std::string &key)
Open testing file.
constexpr const char * k_alb_odometry
TEST_F(AlbPublisherTest, openTrackingFile)
Test to check opening the tracking testing file.
void onMessageReceived(const typename ROSMessageType::ConstPtr &msg)
Callback function on the subscriber.
void readAndPublish(AlbPublisher &albPublisher)
Function to read all data and publish them.
int main(int argc, char **argv)
void publish(const Tlv::tlv_s *frame)
Publish messages from the ALB frame.
constexpr const char * k_alb_objects
constexpr const char * k_alb_pose
constexpr const char * k_alb_augmented_cloud
bool hasParam(const std::string &key) const
constexpr const size_t k_slam_messages
std::vector< std::string > custom_parameters
Class to test the AlbPublisher topics.
constexpr const char * k_alb_time_ref
void setParam(const std::string &key, const XmlRpc::XmlRpcValue &v) const
constexpr const char * k_alb_time_ref_config
void setTestParam(const std::string &key, bool value)
Set test parameter to execute test(s).
constexpr const char * k_alb_slam_file
constexpr const char * k_alb_point_cloud
ROSCPP_DECL void spinOnce()
tlv_s * readFromFile(FILE *in_fd, uint8_t *&out_buffer, size_t &out_buffer_sz)
constexpr const char * k_alb_augmented_cloud_config
void subscribeTo(const std::string &topic)
Subscribe to the given topic with the template ROS message.