18 #include <hazard_detection/hazard_detection.hpp>
21 HazardDetection::HazardDetection(
void)
24 if(!nh_.getParam(
"/rapp_hazard_detection_light_check_topic", lightCheckTopic_))
26 ROS_ERROR(
"Light check topic param does not exist");
30 lightCheckService_ = nh_.advertiseService(lightCheckTopic_,
31 &HazardDetection::lightCheckCallback,
this);
34 if(!nh_.getParam(
"/rapp_hazard_detection_door_check_topic", doorCheckTopic_))
36 ROS_ERROR(
"Door check topic param does not exist");
40 doorCheckService_ = nh_.advertiseService(doorCheckTopic_,
41 &HazardDetection::doorCheckCallback,
this);
44 bool HazardDetection::lightCheckCallback(
45 rapp_platform_ros_communications::LightCheckRosSrv::Request& req,
46 rapp_platform_ros_communications::LightCheckRosSrv::Response& res )
48 int light_level = light_check.process(req.imageFilename);
49 res.light_level = light_level;
53 bool HazardDetection::doorCheckCallback(
54 rapp_platform_ros_communications::DoorCheckRosSrv::Request& req,
55 rapp_platform_ros_communications::DoorCheckRosSrv::Response& res )
57 int door_angle = door_check.process(req.imageFilename);
58 res.door_angle = door_angle;