Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
259 changes: 133 additions & 126 deletions include/pub_map.hpp

Large diffs are not rendered by default.

24 changes: 4 additions & 20 deletions include/scan_preprocessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@
#include <std_msgs/msg/header.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>

#include "tsq.hpp"
#include "util.hpp"
#include "geometry.hpp"
#include "cloud_ops.hpp"
#include "point_def.hpp"
#include "imu_integrator.hpp"
#include "tsq.hpp"

#define DESKEW_ROT_THRESH_RAD 1e-3

Expand Down Expand Up @@ -175,29 +176,12 @@ class ScanPreprocessor
}

protected:
struct TransparentStringHash
{
using is_transparent = void;
size_t operator()(std::string_view s) const noexcept
{
return std::hash<std::string_view>{}(s);
}
};
struct TransparentStringEq
{
using is_transparent = void;
bool operator()(std::string_view a, std::string_view b) const noexcept
{
return a == b;
}
};

template<typename T>
using UoStrMultiMap = std::unordered_multimap<
std::string,
T,
TransparentStringHash,
TransparentStringEq>;
util::TransparentStringHash,
util::TransparentStringEq>;

using TfZoneList = std::pair<Iso3f, std::vector<Box3f>>;

Expand Down
27 changes: 27 additions & 0 deletions include/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <string>
#include <chrono>
#include <memory>
#include <string_view>
#include <type_traits>

#include <rclcpp/rclcpp.hpp>
Expand Down Expand Up @@ -138,6 +139,15 @@ inline builtin_interfaces::msg::Time toTimeStamp(double t_secs)
}


template<typename ros_T, typename primitive_T>
inline ros_T to_ros_val(primitive_T v)
{
static_assert(std::is_same<typename ros_T::_data_type, primitive_T>::value);

return ros_T{}.set__data(v);
}


/* Create a shared pointer from a stack-allocated variable pointer. Make sure
* the object will outlast the shared pointer scope! */
template<typename T>
Expand All @@ -153,6 +163,23 @@ inline std::shared_ptr<T> wrap_unmanaged(T& x)
return std::shared_ptr<T>(&x, [](T*) {});
}

struct TransparentStringHash
{
using is_transparent = void;
size_t operator()(std::string_view s) const noexcept
{
return std::hash<std::string_view>{}(s);
}
};
struct TransparentStringEq
{
using is_transparent = void;
bool operator()(std::string_view a, std::string_view b) const noexcept
{
return a == b;
}
};

}; // namespace util

#define DECLARE_IMMOVABLE(Typename) \
Expand Down
8 changes: 5 additions & 3 deletions src/core/perception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ namespace csm
namespace perception
{

struct PerceptionConfig;

class PerceptionNode : public rclcpp::Node
{
protected:
Expand All @@ -95,9 +97,9 @@ class PerceptionNode : public rclcpp::Node
void shutdown();

protected:
void getParams(void* = nullptr);
void initPubSubs(void* = nullptr);
void printStartup(void* = nullptr);
void getParams(PerceptionConfig& cfg);
void initPubSubs(PerceptionConfig& cfg);
void printStartup(PerceptionConfig& cfg);

private:
// --- TRANSFORM UTILITEIS -------------------------------------------------
Expand Down
Loading