Skip to content

Commit

Permalink
renamed some more reference lists to reference arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
matemat13 committed Sep 13, 2024
1 parent 7a21b99 commit e31d226
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions launch/control_manager.launch
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@
<remap from="~set_heading_in" to="~set_heading" />
<remap from="~set_heading_relative_in" to="~set_heading_relative" />
<remap from="~transform_reference_in" to="~transform_reference" />
<remap from="~transform_reference_list_in" to="~transform_reference_list" />
<remap from="~transform_reference_array_in" to="~transform_reference_array" />
<remap from="~transform_pose_in" to="~transform_pose" />
<remap from="~transform_vector3_in" to="~transform_vector3" />
<remap from="~validate_reference_in" to="~validate_reference" />
<remap from="~validate_reference_2d_in" to="~validate_reference_2d" />
<remap from="~validate_reference_list_in" to="~validate_reference_list" />
<remap from="~validate_reference_array_in" to="~validate_reference_array" />
<remap from="~set_min_z_in" to="~set_min_z" />

<!-- Publishers -->
Expand Down
14 changes: 7 additions & 7 deletions src/control_manager/control_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,14 +475,14 @@ class ControlManager : public nodelet::Nodelet {

// transform service servers
ros::ServiceServer service_server_transform_reference_;
ros::ServiceServer service_server_transform_reference_list_;
ros::ServiceServer service_server_transform_reference_array_;
ros::ServiceServer service_server_transform_pose_;
ros::ServiceServer service_server_transform_vector3_;

// safety area services
ros::ServiceServer service_server_validate_reference_;
ros::ServiceServer service_server_validate_reference_2d_;
ros::ServiceServer service_server_validate_reference_list_;
ros::ServiceServer service_server_validate_reference_array_;

// bumper service servers
ros::ServiceServer service_server_bumper_enabler_;
Expand Down Expand Up @@ -1844,14 +1844,14 @@ void ControlManager::initialize(void) {
service_server_parachute_ = nh_.advertiseService("parachute_in", &ControlManager::callbackParachute, this);
service_server_set_min_z_ = nh_.advertiseService("set_min_z_in", &ControlManager::callbackSetMinZ, this);
service_server_transform_reference_ = nh_.advertiseService("transform_reference_in", &ControlManager::callbackTransformReference, this);
service_server_transform_reference_list_ = nh_.advertiseService("transform_reference_list_in", &ControlManager::callbackTransformReferenceArray, this);
service_server_transform_reference_array_ = nh_.advertiseService("transform_reference_array_in", &ControlManager::callbackTransformReferenceArray, this);
service_server_transform_pose_ = nh_.advertiseService("transform_pose_in", &ControlManager::callbackTransformPose, this);
service_server_transform_vector3_ = nh_.advertiseService("transform_vector3_in", &ControlManager::callbackTransformVector3, this);
service_server_bumper_enabler_ = nh_.advertiseService("bumper_in", &ControlManager::callbackEnableBumper, this);
service_server_get_min_z_ = nh_.advertiseService("get_min_z_in", &ControlManager::callbackGetMinZ, this);
service_server_validate_reference_ = nh_.advertiseService("validate_reference_in", &ControlManager::callbackValidateReference, this);
service_server_validate_reference_2d_ = nh_.advertiseService("validate_reference_2d_in", &ControlManager::callbackValidateReference2d, this);
service_server_validate_reference_list_ = nh_.advertiseService("validate_reference_list_in", &ControlManager::callbackValidateReferenceArray, this);
service_server_validate_reference_array_ = nh_.advertiseService("validate_reference_array_in", &ControlManager::callbackValidateReferenceArray, this);
service_server_start_trajectory_tracking_ = nh_.advertiseService("start_trajectory_tracking_in", &ControlManager::callbackStartTrajectoryTracking, this);
service_server_stop_trajectory_tracking_ = nh_.advertiseService("stop_trajectory_tracking_in", &ControlManager::callbackStopTrajectoryTracking, this);
service_server_resume_trajectory_tracking_ = nh_.advertiseService("resume_trajectory_tracking_in", &ControlManager::callbackResumeTrajectoryTracking, this);
Expand Down Expand Up @@ -5000,10 +5000,10 @@ bool ControlManager::callbackTransformReferenceArray(mrs_msgs::TransformReferenc
return false;
}

// transform the reference list to the current frame
// transform the reference array to the current frame
const auto tf_opt = transformer_->getTransform(req.array.header.frame_id, req.to_frame_id, req.array.header.stamp);
if (!tf_opt.has_value()) {
res.message = "The reference list could not be transformed";
res.message = "The reference array could not be transformed";
res.success = false;
return true;
}
Expand All @@ -5025,7 +5025,7 @@ bool ControlManager::callbackTransformReferenceArray(mrs_msgs::TransformReferenc

} else {

res.message = "The reference list could not be transformed";
res.message = "The reference array could not be transformed";
res.success = false;
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion test/control_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ add_subdirectory(reference_topic)

add_subdirectory(validate_reference_service)

add_subdirectory(validate_reference_list_service)
add_subdirectory(validate_reference_array_service)

add_subdirectory(transform_reference_service)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool Tester::test() {
}
}

mrs_msgs::ValidateReferenceListRequest req;
mrs_msgs::ValidateReferenceArrayRequest req;

req.list.header.frame_id = _uav_name_ + "/world_origin";

Expand Down Expand Up @@ -81,11 +81,11 @@ bool Tester::test() {
}

{
auto [success, response] = uh->validateReferenceList(req);
auto [success, response] = uh->validateReferenceArray(req);

if (!success) {

ROS_ERROR("[%s]: reference list validation service call failed: '%s'", ros::this_node::getName().c_str(), response->message.c_str());
ROS_ERROR("[%s]: reference array validation service call failed: '%s'", ros::this_node::getName().c_str(), response->message.c_str());
return false;

} else {
Expand Down Expand Up @@ -117,11 +117,11 @@ bool Tester::test() {
{
req.list.header.frame_id = "frame_that_does_not_exist";

auto [success, response] = uh->validateReferenceList(req);
auto [success, response] = uh->validateReferenceArray(req);

if (success) {

ROS_ERROR("[%s]: reference list validation service call succeeded but it should not have", ros::this_node::getName().c_str());
ROS_ERROR("[%s]: reference array validation service call succeeded but it should not have", ros::this_node::getName().c_str());
return false;
}
}
Expand Down

0 comments on commit e31d226

Please sign in to comment.