Skip to content

Commit

Permalink
Update axros submodule and fix pre-commit errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrxyz committed Sep 21, 2024
1 parent c63b165 commit 000f26b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion mil_common/axros
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <mil_msgs/ObjectDBQuery.h>
#include <nav_msgs/Odometry.h>
#include <ros/ros.h>
#include <std_msgs/Float32.h>
#include <sensor_msgs/PointCloud2.h>
#include <std_msgs/Float32.h>
#include <std_srvs/Trigger.h>
#include <tf2/convert.h>
#include <tf2_eigen/tf2_eigen.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
#include <pcl/registration/correspondence_estimation.h>
#include <pcl/registration/correspondence_rejection_trimmed.h>
#include <pcl/search/octree.h>
#include <ros/ros.h>
#include <tf/transform_listener.h>

#include <point_cloud_object_detection_and_recognition/object_associator.hpp>
#include <unordered_set>

#include <ros/ros.h>
#include <tf/transform_listener.h>

namespace pcodar
{
void Associator::associate(ObjectMap& prev_objects, point_cloud const& pc, clusters_t clusters, bool moving_back)
{
// Tracks which clusters have been seen
std::unordered_set<uint> seen;

// Establish Area of Interest (AOI) that new points are not allowed to be published while Navigator is moving backwards
Eigen::Vector3f min_aoi(0.0f, -5.0f, -0.5f); // Min bounds (x, y, z)
Eigen::Vector3f max_aoi(10.0f, 5.0f, 0.5f); // Max bounds (x, y, z)
// Establish Area of Interest (AOI) that new points are not allowed to be published while Navigator is moving
// backwards
Eigen::Vector3f min_aoi(0.0f, -5.0f, -0.5f); // Min bounds (x, y, z)
Eigen::Vector3f max_aoi(10.0f, 5.0f, 0.5f); // Max bounds (x, y, z)

// Iterate through each new cluster, finding which persistent cluster(s) it matches
for (cluster_t const& cluster : clusters)
Expand Down Expand Up @@ -48,7 +48,7 @@ void Associator::associate(ObjectMap& prev_objects, point_cloud const& pc, clust
}

// If Navigator is moving back, new objects outside of the AOI are invalid
if(moving_back)
if (moving_back)
{
// Compute the centroid of the cluster
Eigen::Vector4f centroid;
Expand Down Expand Up @@ -76,9 +76,9 @@ void Associator::associate(ObjectMap& prev_objects, point_cloud const& pc, clust
// Check if the centroid is outside the AOI
bool outside_aoi = (centroid[0] < min_aoi[0] || centroid[0] > max_aoi[0] || // X bounds
centroid[1] < min_aoi[1] || centroid[1] > max_aoi[1] || // Y bounds
centroid[2] < min_aoi[2] || centroid[2] > max_aoi[2]); // Z bounds
centroid[2] < min_aoi[2] || centroid[2] > max_aoi[2]); // Z bounds

if(!outside_aoi)
if (!outside_aoi)
{
std::cout << centroid[0] << ", " << centroid[1] << ", " << centroid[2] << "\n";
continue;
Expand All @@ -102,11 +102,11 @@ void Associator::associate(ObjectMap& prev_objects, point_cloud const& pc, clust
}
}
}
catch (tf::TransformException &ex)
catch (tf::TransformException& ex)
{
ROS_ERROR("%s", ex.what());
ros::Duration(1.0).sleep();
continue; // Skip this iteration if the transform fails
ROS_ERROR("%s", ex.what());
ros::Duration(1.0).sleep();
continue; // Skip this iteration if the transform fails
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void Node::ConfigCallback(Config const& config, uint32_t level)
void Node::initialize()
{
NodeBase::initialize();
// Subscribe to odom
// Subscribe to odom
fl_sub = nh_.subscribe("/wamv/thrusters/FL_thrust_cmd", 1, &Node::thrust_fl_cb, this);
fr_sub = nh_.subscribe("/wamv/thrusters/FR_thrust_cmd", 1, &Node::thrust_fr_cb, this);

Expand Down

0 comments on commit 000f26b

Please sign in to comment.