@@ -48,11 +48,11 @@ static constexpr double EPSILON = 1e-5;
4848static const char BASE_FRAME_ID[]{" base_link" };
4949static const char SOURCE_FRAME_ID[]{" base_source" };
5050static const char ODOM_FRAME_ID[]{" odom" };
51- static const char SCAN_NAME[]{" Scan " };
52- static const char POINTCLOUD_NAME[]{" PointCloud " };
53- static const char RANGE_NAME[]{" Range " };
54- static const char POLYGON_NAME[]{" Polygon " };
55- static const char COSTMAP_NAME[]{" Costmap " };
51+ static const char SCAN_NAME[]{" scan " };
52+ static const char POINTCLOUD_NAME[]{" pointcloud " };
53+ static const char RANGE_NAME[]{" range " };
54+ static const char POLYGON_NAME[]{" polygon " };
55+ static const char COSTMAP_NAME[]{" costmap " };
5656static const char STATE_TOPIC[]{" collision_detector_state" };
5757static const char COLLISION_POINTS_MARKERS_TOPIC[]{" /collision_detector/collision_points_marker" };
5858static const int MIN_POINTS{1 };
@@ -559,9 +559,9 @@ bool Tester::waitData(
559559TEST_F (Tester, testIncorrectPolygonType)
560560{
561561 setCommonParameters ();
562- addPolygon (" UnknownShape " , POLYGON_UNKNOWN, 1.0 , " none" );
562+ addPolygon (" unknown_shape " , POLYGON_UNKNOWN, 1.0 , " none" );
563563 addSource (SCAN_NAME, SCAN);
564- setVectors ({" UnknownShape " }, {SCAN_NAME});
564+ setVectors ({" unknown_shape " }, {SCAN_NAME});
565565
566566 // Check that Collision Detector node can not be configured for this parameters set
567567 cd_->cant_configure ();
@@ -570,9 +570,9 @@ TEST_F(Tester, testIncorrectPolygonType)
570570TEST_F (Tester, testIncorrectActionType)
571571{
572572 setCommonParameters ();
573- addPolygon (" DetectionRegion " , POLYGON, 1.0 , " approach" );
573+ addPolygon (" detection_region " , POLYGON, 1.0 , " approach" );
574574 addSource (SCAN_NAME, SCAN);
575- setVectors ({" DetectionRegion " }, {SCAN_NAME});
575+ setVectors ({" detection_region " }, {SCAN_NAME});
576576
577577 // Check that Collision Detector node can not be configured for this action type
578578 cd_->cant_configure ();
@@ -581,9 +581,9 @@ TEST_F(Tester, testIncorrectActionType)
581581TEST_F (Tester, testIncorrectSourceType)
582582{
583583 setCommonParameters ();
584- addPolygon (" DetectionRegion " , POLYGON, 1.0 , " none" );
585- addSource (" UnknownSource " , SOURCE_UNKNOWN);
586- setVectors ({" DetectionRegion " }, {" UnknownSource " });
584+ addPolygon (" detection_region " , POLYGON, 1.0 , " none" );
585+ addSource (" unknown_source " , SOURCE_UNKNOWN);
586+ setVectors ({" detection_region " }, {" unknown_source " });
587587
588588 // Check that Collision Detector node can not be configured for this parameters set
589589 cd_->cant_configure ();
@@ -592,7 +592,7 @@ TEST_F(Tester, testIncorrectSourceType)
592592TEST_F (Tester, testPolygonsNotSet)
593593{
594594 setCommonParameters ();
595- addPolygon (" DetectionRegion " , POLYGON, 1.0 , " none" );
595+ addPolygon (" detection_region " , POLYGON, 1.0 , " none" );
596596 addSource (SCAN_NAME, SCAN);
597597
598598 // Check that Collision Detector node can not be configured for this parameters set
@@ -602,11 +602,11 @@ TEST_F(Tester, testPolygonsNotSet)
602602TEST_F (Tester, testSourcesNotSet)
603603{
604604 setCommonParameters ();
605- addPolygon (" DetectionRegion " , POLYGON, 1.0 , " none" );
605+ addPolygon (" detection_region " , POLYGON, 1.0 , " none" );
606606 addSource (SCAN_NAME, SCAN);
607607 cd_->declare_parameter (
608608 " polygons" ,
609- rclcpp::ParameterValue (std::vector<std::string>{" DetectionRegion " }));
609+ rclcpp::ParameterValue (std::vector<std::string>{" detection_region " }));
610610
611611 // Check that Collision Detector node can not be configured for this parameters set
612612 cd_->cant_configure ();
@@ -615,9 +615,9 @@ TEST_F(Tester, testSourcesNotSet)
615615TEST_F (Tester, testSuccessfulConfigure)
616616{
617617 setCommonParameters ();
618- addPolygon (" DetectionRegion " , POLYGON, 1.0 , " none" );
618+ addPolygon (" detection_region " , POLYGON, 1.0 , " none" );
619619 addSource (SCAN_NAME, SCAN);
620- setVectors ({" DetectionRegion " }, {SCAN_NAME});
620+ setVectors ({" detection_region " }, {SCAN_NAME});
621621
622622 // Check that Collision Detector node can be configured successfully for this parameters set
623623 cd_->configure ();
@@ -628,9 +628,9 @@ TEST_F(Tester, testProcessNonActive)
628628 rclcpp::Time curr_time = cd_->now ();
629629
630630 setCommonParameters ();
631- addPolygon (" DetectionRegion " , POLYGON, 1.0 , " none" );
631+ addPolygon (" detection_region " , POLYGON, 1.0 , " none" );
632632 addSource (SCAN_NAME, SCAN);
633- setVectors ({" DetectionRegion " }, {SCAN_NAME});
633+ setVectors ({" detection_region " }, {SCAN_NAME});
634634
635635 // Configure Collision Detector node, but not activate
636636 cd_->configure ();
@@ -647,9 +647,9 @@ TEST_F(Tester, testProcessActive)
647647 rclcpp::Time curr_time = cd_->now ();
648648
649649 setCommonParameters ();
650- addPolygon (" DetectionRegion " , POLYGON, 1.0 , " none" );
650+ addPolygon (" detection_region " , POLYGON, 1.0 , " none" );
651651 addSource (SCAN_NAME, SCAN);
652- setVectors ({" DetectionRegion " }, {SCAN_NAME});
652+ setVectors ({" detection_region " }, {SCAN_NAME});
653653
654654 // Configure and activate Collision Detector node
655655 cd_->start ();
@@ -667,17 +667,17 @@ TEST_F(Tester, testPolygonDetection)
667667 // Set Collision Detector parameters.
668668 setCommonParameters ();
669669 // Create polygon
670- addPolygon (" DetectionRegion " , POLYGON, 2.0 , " none" );
670+ addPolygon (" detection_region " , POLYGON, 2.0 , " none" );
671671 addSource (RANGE_NAME, RANGE);
672- setVectors ({" DetectionRegion " }, {RANGE_NAME});
672+ setVectors ({" detection_region " }, {RANGE_NAME});
673673
674674 // Start Collision Detector node
675675 cd_->start ();
676676
677677 // Share TF
678678 sendTransforms (curr_time);
679679
680- // Obstacle is in DetectionRegion
680+ // Obstacle is in detection_region
681681 publishRange (1.5 , curr_time);
682682
683683 ASSERT_TRUE (waitData (1.5 , 300ms, curr_time));
@@ -696,17 +696,17 @@ TEST_F(Tester, testCircleDetection)
696696 // Set Collision Detector parameters.
697697 setCommonParameters ();
698698 // Create Circle
699- addPolygon (" DetectionRegion " , CIRCLE, 3.0 , " none" );
699+ addPolygon (" detection_region " , CIRCLE, 3.0 , " none" );
700700 addSource (RANGE_NAME, RANGE);
701- setVectors ({" DetectionRegion " }, {RANGE_NAME});
701+ setVectors ({" detection_region " }, {RANGE_NAME});
702702
703703 // Start Collision Detector node
704704 cd_->start ();
705705
706706 // Share TF
707707 sendTransforms (curr_time);
708708
709- // Obstacle is in DetectionRegion
709+ // Obstacle is in detection_region
710710 publishRange (1.5 , curr_time);
711711
712712 ASSERT_TRUE (waitData (1.5 , 300ms, curr_time));
@@ -725,17 +725,17 @@ TEST_F(Tester, testScanDetection)
725725 // Set Collision Detector parameters.
726726 setCommonParameters ();
727727 // Create polygon
728- addPolygon (" DetectionRegion " , CIRCLE, 3.0 , " none" );
728+ addPolygon (" detection_region " , CIRCLE, 3.0 , " none" );
729729 addSource (SCAN_NAME, SCAN);
730- setVectors ({" DetectionRegion " }, {SCAN_NAME});
730+ setVectors ({" detection_region " }, {SCAN_NAME});
731731
732732 // Start Collision Detector node
733733 cd_->start ();
734734
735735 // Share TF
736736 sendTransforms (curr_time);
737737
738- // Obstacle is in DetectionRegion
738+ // Obstacle is in detection_region
739739 publishScan (1.5 , curr_time);
740740
741741 ASSERT_TRUE (waitData (1.5 , 300ms, curr_time));
@@ -754,17 +754,17 @@ TEST_F(Tester, testPointcloudDetection)
754754 // Set Collision Detector parameters.
755755 setCommonParameters ();
756756 // Create polygon
757- addPolygon (" DetectionRegion " , CIRCLE, 3.0 , " none" );
757+ addPolygon (" detection_region " , CIRCLE, 3.0 , " none" );
758758 addSource (POINTCLOUD_NAME, POINTCLOUD);
759- setVectors ({" DetectionRegion " }, {POINTCLOUD_NAME});
759+ setVectors ({" detection_region " }, {POINTCLOUD_NAME});
760760
761761 // Start Collision Detector node
762762 cd_->start ();
763763
764764 // Share TF
765765 sendTransforms (curr_time);
766766
767- // Obstacle is in DetectionRegion
767+ // Obstacle is in detection_region
768768 publishPointCloud (2.5 , curr_time);
769769
770770 ASSERT_TRUE (waitData (std::hypot (2.5 , 0.01 ), 500ms, curr_time));
@@ -783,17 +783,17 @@ TEST_F(Tester, testPolygonSourceDetection)
783783 // Set Collision Detector parameters.
784784 setCommonParameters ();
785785 // Create polygon
786- addPolygon (" DetectionRegion " , CIRCLE, 3.0 , " none" );
786+ addPolygon (" detection_region " , CIRCLE, 3.0 , " none" );
787787 addSource (POLYGON_NAME, POLYGON_SOURCE);
788- setVectors ({" DetectionRegion " }, {POLYGON_NAME});
788+ setVectors ({" detection_region " }, {POLYGON_NAME});
789789
790790 // Start Collision Detector node
791791 cd_->start ();
792792
793793 // Share TF
794794 sendTransforms (curr_time);
795795
796- // Obstacle is in DetectionRegion
796+ // Obstacle is in detection_region
797797 publishPolygon (2.5 , curr_time);
798798
799799 ASSERT_TRUE (waitData (std::hypot (2.5 , 1.0 ), 500ms, curr_time));
@@ -812,17 +812,17 @@ TEST_F(Tester, testCostmapDetection)
812812 // Set Collision Detector parameters.
813813 setCommonParameters ();
814814 // Create polygon
815- addPolygon (" DetectionRegion " , CIRCLE, 3.0 , " none" );
815+ addPolygon (" detection_region " , CIRCLE, 3.0 , " none" );
816816 addSource (COSTMAP_NAME, COSTMAP);
817- setVectors ({" DetectionRegion " }, {COSTMAP_NAME});
817+ setVectors ({" detection_region " }, {COSTMAP_NAME});
818818
819819 // Start Collision Detector node
820820 cd_->start ();
821821
822822 // Share TF
823823 sendTransforms (curr_time);
824824
825- // Obstacle is in DetectionRegion
825+ // Obstacle is in detection_region
826826 publishCostmap (1.5 , curr_time);
827827
828828 ASSERT_TRUE (waitData (1.5 , 500ms, curr_time));
0 commit comments