Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patchwork Paper implementation using ROS 2. #142

Merged
merged 62 commits into from
Sep 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
8b9306a
Copy transformer samples to occupancy_seg
akilpath Jun 1, 2024
72686d7
Copied transformer node layout
akilpath Jun 4, 2024
55f41eb
Renamed files
akilpath Jun 8, 2024
62c7407
Fix small error
VishGit1234 Jun 8, 2024
29ca16c
Clean up
akilpath Jun 13, 2024
d021201
Add pcl package
VishGit1234 Jun 16, 2024
3368d02
Added eigen to dockerifle
akilpath Jun 17, 2024
3ccbbfb
Update docker-compose.world_modeling.yaml
VishGit1234 Jun 19, 2024
c98364d
Update docker-compose.world_modeling.yaml
VishGit1234 Jun 19, 2024
54ad82c
Merge branch 'groundseg-akil' of github.com:WATonomous/wato_monorepo …
akilpath Jun 19, 2024
bbd14b9
added tbb to dockerfile
akilpath Jun 19, 2024
1db81c7
Started working on it
akilpath Jun 23, 2024
9d7e706
Finished czm initialization
akilpath Jun 23, 2024
67b27d8
Plane
akilpath Jun 26, 2024
23aafe4
Mostly done
akilpath Jul 7, 2024
ed459ae
Add apt update
VishGit1234 Jul 9, 2024
c67d821
Fixing small bugs
akilpath Jul 18, 2024
ae006c0
Build / make error with core.cpp
akilpath Jul 20, 2024
206efe3
Added main node code, still fails build
akilpath Jul 20, 2024
bdb8e2f
Commented some things to get it to compile
akilpath Jul 22, 2024
795bdd9
Builds
akilpath Jul 24, 2024
5ed8b81
Foxglove setup plus error debugging
akilpath Jul 30, 2024
884156d
Templated Core file
akilpath Aug 2, 2024
34d1641
lowkey works
akilpath Aug 6, 2024
3f1dadd
Added headers to publishers
akilpath Aug 7, 2024
6527570
Copy transformer samples to occupancy_seg
akilpath Jun 1, 2024
cdba3f3
Copied transformer node layout
akilpath Jun 4, 2024
6605e3f
Renamed files
akilpath Jun 8, 2024
67bda39
Fix small error
VishGit1234 Jun 8, 2024
45767c8
Clean up
akilpath Jun 13, 2024
b74770c
Add pcl package
VishGit1234 Jun 16, 2024
f947fd5
Added eigen to dockerifle
akilpath Jun 17, 2024
49076c9
Update docker-compose.world_modeling.yaml
VishGit1234 Jun 19, 2024
75a1c9e
Update docker-compose.world_modeling.yaml
VishGit1234 Jun 19, 2024
b36ebec
added tbb to dockerfile
akilpath Jun 19, 2024
f9e0f33
Started working on it
akilpath Jun 23, 2024
0a4d547
Finished czm initialization
akilpath Jun 23, 2024
7ade2d1
Plane
akilpath Jun 26, 2024
70fd598
Mostly done
akilpath Jul 7, 2024
310e9d2
Add apt update
VishGit1234 Jul 9, 2024
957ead8
Fixing small bugs
akilpath Jul 18, 2024
aa06560
Build / make error with core.cpp
akilpath Jul 20, 2024
6077369
Added main node code, still fails build
akilpath Jul 20, 2024
e0bd23d
Commented some things to get it to compile
akilpath Jul 22, 2024
fdf562c
Builds
akilpath Jul 24, 2024
c78f67c
Foxglove setup plus error debugging
akilpath Jul 30, 2024
ffcb771
Templated Core file
akilpath Aug 2, 2024
808946d
lowkey works
akilpath Aug 6, 2024
fb9409e
Added headers to publishers
akilpath Aug 7, 2024
cee8212
Remove watod-config changes
VishGit1234 Aug 11, 2024
711e8ab
Merge branch 'groundseg-akil' of github.com:WATonomous/wato_monorepo …
akilpath Aug 13, 2024
8beed8f
Cleanup + Timing for patchwork
akilpath Aug 13, 2024
ca3feef
Update watod-config.sh
VishGit1234 Aug 13, 2024
1476040
Update docker_context.sh
VishGit1234 Aug 13, 2024
2aa306d
Fix code style issues with clang_format
WATonomousAdmin Aug 13, 2024
9b6fff3
added ros params
VishGit1234 Sep 12, 2024
00340a7
Fix code style issues with clang_format
WATonomousAdmin Sep 12, 2024
06c9902
Removed adaptive seed selection for 1st zone
akilpath Sep 17, 2024
79f8cef
Made adaptive seed selection into toggle param
akilpath Sep 17, 2024
47193cf
Put num_zones in params
VishGit1234 Sep 19, 2024
7f06596
Merge branch 'main' into groundseg-akil
VishGit1234 Sep 20, 2024
5915c67
Fix code style issues with clang_format
WATonomousAdmin Sep 20, 2024
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
Prev Previous commit
Next Next commit
Started working on it
akilpath authored and VishGit1234 committed Aug 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit f9e0f33176b2f9395b9c963d1162b613f64184b0
2 changes: 0 additions & 2 deletions src/world_modeling/occupancy_segmentation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -13,7 +13,6 @@ endif()
# Search for dependencies required for building this package
find_package(ament_cmake REQUIRED) # ROS2 build tool
find_package(rclcpp REQUIRED) # ROS2 C++ package
find_package(sample_msgs REQUIRED) # Custom package containing ROS2 messages
find_package(pcl_ros REQUIRED)

# Compiles source files into a library
@@ -30,7 +29,6 @@ target_include_directories(occupancy_segmentation_lib
# Add ROS2 dependencies required by package
ament_target_dependencies(occupancy_segmentation_lib
rclcpp
sample_msgs
pcl_ros)

# # By default tests are built. This can be overridden by modifying the
Original file line number Diff line number Diff line change
@@ -2,22 +2,47 @@
#define OCCUPANCY_SEGMENTATION_CORE_HPP_

#include <vector>
#include <pcl_conversions/pcl_conversions.h>
#include <pcl/common/centroid.h>
#include <pcl/io/pcd_io.h>

#include <tbb/parallel_for.h>
#include <tbb/blocked_range.h>


#define NUM_ZONES 4
#define L_MIN 2.7
#define L_MAX 80.0


/**
* Implementation for the internal logic for the Transformer ROS2
* node performing data processing and validation.
*/
class OccupancySegmentationCore {
public:
// Size of buffer before processed messages are published.
static constexpr int BUFFER_CAPACITY = 10;

public:
/**
* Transformer constructor.
*/
OccupancySegmentationCore();
public:
typedef std::vector<pcl::PointCloud<pcl::PointXYZ>> Ring;
typedef std::vector<Ring> Zone;
// Size of buffer before processed messages are published.
static constexpr int BUFFER_CAPACITY = 10;

const int ZONE_RINGS [NUM_ZONES] = {2,4,4,4};
const int ZONE_SECTORS [NUM_ZONES] = {16,32,54,32};


std::vector<Zone> czm;


OccupancySegmentationCore();

private:

void init_czm();

void fill_czm(pcl::PointCloud<pcl::PointXYZ> &cloud_in);



};


1 change: 0 additions & 1 deletion src/world_modeling/occupancy_segmentation/package.xml
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
<!--https://www.ros.org/reps/rep-0149.html#dependency-tags-->
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>rclcpp</depend>
<depend>sample_msgs</depend>
<depend>pcl_ros</depend>

<test_depend>ament_cmake_gtest</test_depend>
Original file line number Diff line number Diff line change
@@ -4,4 +4,42 @@
#include "occupancy_segmentation_core.hpp"


OccupancySegmentationCore::OccupancySegmentationCore() {}
OccupancySegmentationCore::OccupancySegmentationCore() {}

void OccupancySegmentationCore::init_czm(){
std::vector<Zone> temp_czm;
czm = temp_czm;
for(int zone_idx = 0; zone_idx < NUM_ZONES; zone_idx++){
Zone zone;
for(int r = 0; r < ZONE_RINGS[zone_idx]; r++){
Ring ring;
for (int s = 0; s < ZONE_SECTORS[zone_idx]; s++){
pcl::PointCloud<pcl::PointXYZ> patch;
ring.emplace_back(patch);
}
zone.emplace_back(ring);
}
czm.emplace_back(zone);
}
}

void OccupancySegmentationCore::fill_czm(pcl::PointCloud<pcl::PointXYZ> &cloud_in){
for(pcl::PointXYZ &p : cloud_in.points){
double r = sqrt(pow(p.x, 2) + pow(p.y, 2));
double theta = atan2(p.y,p.x); // EDITED!
if (theta < 0){
theta += 2*M_PI;
}
double lmins[4] = {L_MIN, (7*L_MIN + L_MAX) / 8, (3*L_MIN + L_MAX) / 4, (L_MIN + L_MAX) / 2};
double lmaxs[4] = {lmins[1], lmins[2], lmins[3], L_MAX};
double deltal = L_MAX - L_MIN;

for (int zone_idx = 0; zone_idx < NUM_ZONES; zone_idx++){

}



}

}
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ void OccupancySegmentationNode::timer_callback(){
}

int main(int argc, char** argv) {
std::cout << "Huh" << std::endl;
rclcpp::init(argc, argv);
rclcpp::spin(std::make_shared<OccupancySegmentationNode>());
rclcpp::shutdown();