@@ -702,7 +702,7 @@ namespace FHAC
702
702
703
703
mobject.header .stamp = rclcpp_lifecycle::LifecycleNode::now ();
704
704
mobject.header .frame_id = radar_link_names_[sensor_id];
705
- mobject.ns = " " ;
705
+ mobject.ns = " track " ;
706
706
mobject.id = itr->first ;
707
707
mobject.type = 1 ; // Cube
708
708
mobject.action = 0 ; // add/modify
@@ -712,7 +712,6 @@ namespace FHAC
712
712
double yaw = itr->second .object_extended .obj_orientationangle .data * 3.1416 / 180.0 ;
713
713
714
714
myQuaternion.setRPY (0 , 0 , yaw);
715
-
716
715
mobject.pose .orientation .w = myQuaternion.getW ();
717
716
mobject.pose .orientation .x = myQuaternion.getX ();
718
717
mobject.pose .orientation .y = myQuaternion.getY ();
@@ -732,7 +731,6 @@ namespace FHAC
732
731
733
732
radar_track.velocity .x = itr->second .object_general .obj_vrellong .data ;
734
733
radar_track.velocity .y = itr->second .object_general .obj_vrellat .data ;
735
- ;
736
734
radar_track.velocity .z = 0.0 ;
737
735
738
736
radar_track.acceleration .x = 0.0 ;
@@ -773,7 +771,39 @@ namespace FHAC
773
771
mobject.pose .position = radar_track.position ;
774
772
mobject.scale = radar_track.size ;
775
773
774
+ visualization_msgs::msg::Marker arrow_vrelong = mobject;
775
+ arrow_vrelong.type = 0 ; // Arrow
776
+ arrow_vrelong.scale .x = radar_track.velocity .x ;
777
+ arrow_vrelong.scale .y = 0.1 ;
778
+ arrow_vrelong.scale .z = 0.1 ;
779
+ arrow_vrelong.ns = " vrelong_arrow" ;
780
+ arrow_vrelong.color .r = 1.0 ;
781
+ arrow_vrelong.color .g = 0.0 ;
782
+ arrow_vrelong.color .b = 0.0 ;
783
+ arrow_vrelong.color .a = 1.0 ;
784
+
785
+ visualization_msgs::msg::Marker arrow_vrelat = mobject;
786
+ auto vrelat_quat = myQuaternion;
787
+ vrelat_quat.setRPY (0 , 0 , yaw + M_PI_2);
788
+ arrow_vrelat.pose .orientation .w = vrelat_quat.getW ();
789
+ arrow_vrelat.pose .orientation .x = vrelat_quat.getX ();
790
+ arrow_vrelat.pose .orientation .y = vrelat_quat.getY ();
791
+ arrow_vrelat.pose .orientation .z = vrelat_quat.getZ ();
792
+
793
+ arrow_vrelat.type = 0 ; // Arrow
794
+ arrow_vrelat.scale .x = radar_track.velocity .y ;
795
+ arrow_vrelat.scale .y = 0.1 ;
796
+ arrow_vrelat.scale .z = 0.1 ;
797
+ arrow_vrelat.ns = " vrelat_arrow" ;
798
+ arrow_vrelat.color .r = 0.0 ;
799
+ arrow_vrelat.color .g = 1.0 ;
800
+ arrow_vrelat.color .b = 0.0 ;
801
+ arrow_vrelat.color .a = 1.0 ;
802
+
776
803
marker_array.markers .push_back (mobject);
804
+ marker_array.markers .push_back (arrow_vrelong);
805
+ marker_array.markers .push_back (arrow_vrelat);
806
+
777
807
radar_tracks.tracks .push_back (radar_track);
778
808
obstacle_array.obstacles .push_back (obstacle);
779
809
}
0 commit comments