Conversation
| pose_sub_topic: "/aruco_detector/board" | ||
| pose_array_pub_topic: "/filtered_pose_array" | ||
| landmark_pub_topic: "/filtered_landmarks" |
There was a problem hiding this comment.
Any reason these topics are not part of the topic list in orca.yaml, like the rest of the packages in vortex-auv?
There was a problem hiding this comment.
This package is not supposed to be used in production. Only for tuning/testing and debugging. The plan is to have the landmark server import the /lib part of this package. So this package will mainly be used to tune for various different obejcts etc.
| /** | ||
| * @brief Get the list of currently maintained tracks. | ||
| * @return const reference to internal track vector | ||
| */ | ||
| const std::vector<Track>& get_tracks() { return tracks_; } |
There was a problem hiding this comment.
Would also add const at the end to signal that the function does not modify
const std::vector<Track>& get_tracks() const;| // Internal bookkeeping | ||
| int track_id_counter_ = 0; |
There was a problem hiding this comment.
Would use brace init for consistency
| void setup_debug_publishers(); | ||
| void publish_meas_debug(); | ||
| void publish_state_debug(); |
There was a problem hiding this comment.
picky, but nice to group methods/member variables
| output='screen', | ||
| parameters=[config, {'use_sim_time': True}], |
There was a problem hiding this comment.
Why is use_sim_time default to true? Do we even have a \clock topic in sim?
There was a problem hiding this comment.
I just used this for testing with a rosbag and then tf2 is very quick to complain about timestamps. I can add a comment explaining its use case
|
|
||
| Eigen::Matrix<double, 3, Eigen::Dynamic> Z(3, measurements.size()); |
There was a problem hiding this comment.
Z? Perhaps a more descriptive name? 😅
| if (q.w() < 0.0) { | ||
| q.coeffs() *= -1.0; | ||
| } | ||
|
|
||
| double norm_v = q.vec().norm(); | ||
|
|
||
| if (norm_v < 1e-6) { | ||
| return 2.0 * q.vec(); | ||
| } |
There was a problem hiding this comment.
for these "magic operations" maybe a comment would be nice
| initial_position_std_ = config.initial_position_std; | ||
| initial_orientation_std_ = config.initial_orientation_std; | ||
| ipda_config_ = config.ipda; | ||
| existence_config_ = config.existence; | ||
| max_angle_gate_threshold_ = config.max_angle_gate_threshold; |
There was a problem hiding this comment.
Perhaps have the config as a member instead of the individual fields?
There was a problem hiding this comment.
I think it might become more cluttered if i do that as the code is now. The most structured solution would probably be to refactor and separate out a position filter similar to the orientation filter class. I will work on that later if I have time.
I should probably add some dynamic reconfiguration of ros parameters to aid in the tuning process and that might reveal a more intuitive struct setup.
| config, | ||
| # {'use_sim_time': True} # If testing with rosbags sim_time might be preferred if bag is looped |
There was a problem hiding this comment.
Same as the other pr, that this could just be default to false instead of commented out
|
|
||
| int timer_rate_ms = this->declare_parameter<int>("timer_rate_ms"); | ||
|
|
||
| filter_dt_seconds_ = static_cast<double>(timer_rate_ms) / 1000; |
There was a problem hiding this comment.
Here is a case where auto is nice, since you already declare it as int so its not necessary to type it twice
const auto timer_rate_ms = this->declare_parameter<int>("timer_rate_ms");Also consider using chrono for time, as it is safer and more expressive when both handing and converting between units (you use chrono in the pub timer anyway)
| std::bind(&PoseFilteringNode::timer_callback, this)); | ||
|
|
| const std::string pose_sub_topic = | ||
| this->declare_parameter<std::string>("pose_sub_topic"); |
There was a problem hiding this comment.
here too regarding using auto for repetitive type-typing
| RCLCPP_WARN( | ||
| this->get_logger(), "TF transform failed from '%s' to '%s': %s", | ||
| msg->header.frame_id.c_str(), target_frame_.c_str(), ex.what()); |
|
Summary of changes: Added landmark type and subtype based pre-filtering. This PR is now blocked by this vortexntnu/vortex-vkf#34 |
Pose filtering ros package plus track manager library.
Mainly used for testing and development.
Intended use case is to have the landmark server include the library and do the landmark filtering