File tree Expand file tree Collapse file tree
stonefish_labeling/sonar_segmentation
include/sonar_segmentation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313 service :
1414 respawn_service : " /stonefish_ros2/respawn_robot"
15+ drone_name : " orca" # Name of the drone for respawn service.
1516
1617 data_format :
1718 fov : 120.0 # Field of view of the sonar and camera in degrees.
1819 sonar_range : 20.0 # Maximum range of the sonar in meters.
20+
21+
22+
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ class SonarSegmentationNode : public rclcpp::Node
6767 double fov_ = 0.0 ;
6868 double vertical_fov_ = 0.0 ;
6969 double sonar_range_ = 0.0 ;
70+ std::string drone_name_;
7071 cv::Mat camera_k_;
7172 std::string output_frame_id_;
7273};
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ void SonarSegmentationNode::declare_parameters() {
2121 this ->declare_parameter <std::string>(" topic.segmentation_camera_info_topic" );
2222
2323 this ->declare_parameter <std::string>(" service.respawn_service" );
24+ this ->declare_parameter <std::string>(" service.drone_name" );
2425
2526 this ->declare_parameter <double >(" data_format.fov" );
2627 this ->declare_parameter <double >(" data_format.sonar_range" );
@@ -30,6 +31,9 @@ void SonarSegmentationNode::declare_parameters() {
3031
3132 sonar_range_ =
3233 this ->get_parameter (" data_format.sonar_range" ).as_double ();
34+
35+ drone_name_ =
36+ this ->get_parameter (" service.drone_name" ).as_string ();
3337}
3438
3539void SonarSegmentationNode::setup_publishers_and_subscribers () {
@@ -117,7 +121,7 @@ void SonarSegmentationNode::callRespawnService() {
117121 std::uniform_real_distribution<> disty (-13 , 2 );
118122 std::uniform_real_distribution<> distyaw (0 , 360 );
119123
120- request->name = " orca " ;
124+ request->name = drone_name_ ;
121125
122126 request->origin .position .x = distx (gen);
123127 request->origin .position .y = disty (gen);
You can’t perform that action at this time.
0 commit comments