Conversation
9cd7063 to
468e0f2
Compare
| waypoint_manager: "waypoint_manager" | ||
| landmark_polling: "landmark_polling" | ||
|
|
||
| services: | ||
| start_mission: "pipeline_inspection_fsm/start_mission" |
There was a problem hiding this comment.
These should be read from the drone config in auv_setup
| landmark_type: 1 | ||
| landmark_subtype: 19 |
There was a problem hiding this comment.
Do these need to be in the config? I think it is better to hardcode them in the source files.
That also allows us to be more explicit like this vortex_msgs::msg::LandmarkSubtype::PIPELINE_START_CAMERA
| fsm: | ||
| landmark_type: 1 | ||
| landmark_subtype: 19 | ||
| convergence_threshold: 0.1 |
There was a problem hiding this comment.
The convergence should be more descriptive. We should find a way to tie it to specific waypoints or landmark convergence actions.
Maybe we should extend load waypoint from yaml to actually return a full waypoint with mode and convergence offset, and not just pose.
And create a load_landmark_convergence_from_yaml as well
There was a problem hiding this comment.
This does not follow vortex convention. Should just declare parameters in the constructor. I dont see any cases here where we will call get_parameter for a parameter that is undeclared
There was a problem hiding this comment.
Pro tip:
declare_parameter also returns the value like this:
std::string frame_id_ = this->declare_parameter<std::string>("frame_id");| std::optional<pipeline_inspection_fsm::WaypointManagerAction::Goal> | ||
| build_search_goal(const std::vector<vortex::utils::types::Pose>& waypoints); | ||
|
|
||
| std::string waypoint_file_path_; |
There was a problem hiding this comment.
Maybe make this global or tied to a parent class so that it is common for all states
| convergence_threshold_ = pipeline_inspection_fsm::param_utils::get_double( | ||
| node, "fsm.convergence_threshold"); | ||
|
|
||
| const double offset_x = pipeline_inspection_fsm::param_utils::get_double( | ||
| node, "fsm.landmark_offset.x"); | ||
| const double offset_y = pipeline_inspection_fsm::param_utils::get_double( | ||
| node, "fsm.landmark_offset.y"); | ||
| const double offset_z = pipeline_inspection_fsm::param_utils::get_double( | ||
| node, "fsm.landmark_offset.z"); | ||
| const double offset_roll = pipeline_inspection_fsm::param_utils::get_double( | ||
| node, "fsm.landmark_offset.roll"); | ||
| const double offset_pitch = | ||
| pipeline_inspection_fsm::param_utils::get_double( | ||
| node, "fsm.landmark_offset.pitch"); | ||
| const double offset_yaw = pipeline_inspection_fsm::param_utils::get_double( | ||
| node, "fsm.landmark_offset.yaw"); |
There was a problem hiding this comment.
If we instead create a function to load landmark convergence goal from yaml we dont need all these declare_parameter calls
| namespace { | ||
|
|
||
| std::string get_string_parameter(const rclcpp::Node::SharedPtr& node, | ||
| const std::string& name) { | ||
| if (!node->has_parameter(name)) | ||
| node->declare_parameter<std::string>(name); | ||
|
|
||
| return node->get_parameter(name).as_string(); | ||
| } | ||
|
|
||
| } // namespace |
There was a problem hiding this comment.
Is it possible to have a separate file for the state definitions and transitions?
| set(DEPENDENCIES | ||
| ament_index_cpp | ||
| rclcpp | ||
| rclcpp_action | ||
| std_srvs | ||
| yasmin | ||
| yasmin_ros | ||
| yasmin_viewer | ||
| vortex_msgs | ||
| vortex_utils | ||
| vortex_utils_ros | ||
| vortex_utils_ros_tf | ||
| geometry_msgs | ||
| tf2 | ||
| tf2_ros | ||
| tf2_geometry_msgs | ||
| ) | ||
|
|
||
| add_executable(pipeline_inspection_fsm | ||
| src/tf_utils.cpp | ||
| src/trigger_wait_state.cpp | ||
| src/wait_for_start_state.cpp | ||
| src/search_pattern_state.cpp | ||
| src/landmark_polling_state.cpp | ||
| src/converge_state.cpp | ||
| src/start_waypoint_manager_state.cpp | ||
| src/wait_for_pipeline_end_state.cpp | ||
| src/stop_waypoint_manager_state.cpp | ||
| src/blackboard.cpp | ||
| src/fsm_runner.cpp | ||
| ) | ||
|
|
||
| ament_target_dependencies(pipeline_inspection_fsm ${DEPENDENCIES}) |
There was a problem hiding this comment.
Dont really need a separate dependencies list if we only use it once
There was a problem hiding this comment.
Thinking about it I think it is easier and more robust to just pass in search waypoint from odom directly. Then it is easier to keep track of where the drone is going/are at all times and we are less susceptible to spontaneous changes in orientation that will change the positions of the waypoints when transforming from base to odom
moved pipeline fsm from vortex auv, this package is a fsm for the pipeline inspection task for tacc.