-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/object detector with aruco marker #5
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
Open
AntoniRL
wants to merge
37
commits into
humble-devel
Choose a base branch
from
feature/object-detector
base: humble-devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
0f37fa3
service setup
AntoniRL 23dd19f
updated pre-commit
AntoniRL caca458
get pose
AntoniRL a46581c
get pose
AntoniRL f19bfab
wip get camera config from ros topic
AntoniRL cc42ad2
update params
AntoniRL 0d4e978
update params
AntoniRL 7f3be5e
camera config from topic
AntoniRL 2e48488
update the camera_frame
AntoniRL cac854a
change the testing program
AntoniRL adab154
update tests - draw pointer
AntoniRL 7861b98
cleaning coments
AntoniRL 77dfb17
get rotation in z axis
AntoniRL e8b76f1
colect data of aruco center
AntoniRL 1356858
bug te error in get pose
AntoniRL 9e2ec76
yaml changes
AntoniRL 75e6d52
cleaning testing and debbuging lines
AntoniRL 97822e0
correct the test scripts
AntoniRL 8eaeb0c
Merge branch 'humble-devel' into feature/object-detector
AntoniRL 434b098
add CHANGELOG
AntoniRL ff03980
cuncle the req in service
AntoniRL 81d2770
order includes
AntoniRL e314e74
snake_case
AntoniRL 11406ab
update message
AntoniRL e01d774
update tests
AntoniRL 6f40d0b
update variable names
AntoniRL 180ae3c
upgrade the quesions
AntoniRL cf32664
update allocating memory
AntoniRL 0e7ccc7
update names of variables
AntoniRL 431ac10
standarize for loops
AntoniRL b495abf
delate all comments
AntoniRL 4c05fcb
sort aplhabetically
AntoniRL 0090414
update CMakeListas
AntoniRL e5691aa
repair tests
AntoniRL 662df35
delate config
AntoniRL db6a739
prek run all files
AntoniRL 4982666
Merge branch 'feature/object-detector' of github.com:AGH-CEAI/scene_o…
AntoniRL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,72 +1,3 @@ | ||
| # Config based on: | ||
| # https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/blob/humble/.clang-format | ||
|
|
||
| --- | ||
| BasedOnStyle: Google | ||
| AccessModifierOffset: -2 | ||
| ConstructorInitializerIndentWidth: 2 | ||
| AlignAfterOpenBracket: AlwaysBreak | ||
| AlignEscapedNewlinesLeft: true | ||
| AlignTrailingComments: true | ||
| AllowAllArgumentsOnNextLine: false | ||
| AllowAllParametersOfDeclarationOnNextLine: false | ||
| PackConstructorInitializers: NextLine | ||
| AllowShortFunctionsOnASingleLine: None | ||
| AllowShortIfStatementsOnASingleLine: false | ||
| AllowShortLoopsOnASingleLine: false | ||
| AlwaysBreakBeforeMultilineStrings: false | ||
| AlwaysBreakTemplateDeclarations: true | ||
| BinPackArguments: false | ||
| BinPackParameters: false | ||
| BreakBeforeBinaryOperators: false | ||
| BreakBeforeTernaryOperators: false | ||
| BreakConstructorInitializersBeforeComma: true | ||
| BasedOnStyle: Chromium | ||
| SortIncludes: false | ||
| ColumnLimit: 120 | ||
| ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
| DerivePointerBinding: false | ||
| PointerBindsToType: true | ||
| ExperimentalAutoDetectBinPacking: false | ||
| IndentCaseLabels: true | ||
| MaxEmptyLinesToKeep: 1 | ||
| NamespaceIndentation: None | ||
| ObjCSpaceBeforeProtocolList: true | ||
| PenaltyBreakBeforeFirstCallParameter: 19 | ||
| PenaltyBreakComment: 60 | ||
| PenaltyBreakString: 1 | ||
| PenaltyBreakFirstLessLess: 1000 | ||
| PenaltyExcessCharacter: 1000 | ||
| PenaltyReturnTypeOnItsOwnLine: 90 | ||
| SpacesBeforeTrailingComments: 2 | ||
| Cpp11BracedListStyle: false | ||
| Standard: Auto | ||
| IndentWidth: 2 | ||
| TabWidth: 2 | ||
| UseTab: Never | ||
| IndentFunctionDeclarationAfterType: false | ||
| SpacesInParentheses: false | ||
| SpacesInAngles: false | ||
| SpaceInEmptyParentheses: false | ||
| SpacesInCStyleCastParentheses: false | ||
| SpacesInContainerLiterals: false | ||
| SpaceAfterControlStatementKeyword: true | ||
| SpaceBeforeAssignmentOperators: true | ||
| ContinuationIndentWidth: 4 | ||
| SortIncludes: true | ||
| SpaceAfterCStyleCast: false | ||
|
|
||
| # Configure each individual brace in BraceWrapping | ||
| BreakBeforeBraces: Custom | ||
|
|
||
| # Control of individual brace wrapping cases | ||
| BraceWrapping: | ||
| AfterCaseLabel: "false" | ||
| AfterClass: "false" | ||
| AfterControlStatement: Never | ||
| AfterEnum: "false" | ||
| AfterFunction: "false" | ||
| AfterNamespace: "false" | ||
| AfterStruct: "false" | ||
| AfterUnion: "false" | ||
| BeforeCatch: "false" | ||
| BeforeElse: "false" | ||
| IndentBraces: "false" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to the `scene_objects_manager` package will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Added | ||
|
|
||
| * [PR-5](https://github.com/AGH-CEAI/scene_objects_manager/pull/5) - Add a service to get the pose of marked objects in the scene. | ||
|
|
||
| ### Changed | ||
| ### Deprecated | ||
| ### Removed | ||
| ### Fixed | ||
| ### Security |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| #ifndef SCENE_OBJECTS_MANAGER__OBJECT_POSE_DETECTOR_HPP_ | ||
| #define SCENE_OBJECTS_MANAGER__OBJECT_POSE_DETECTOR_HPP_ | ||
|
|
||
| #include <cmath> | ||
| #include <fstream> | ||
| #include <mutex> | ||
| #include <optional> | ||
| #include <stdexcept> | ||
| #include <vector> | ||
|
|
||
| #include <opencv2/aruco.hpp> | ||
| #include <opencv2/core.hpp> | ||
| #include <opencv2/opencv.hpp> | ||
| #include <yaml-cpp/yaml.h> | ||
|
|
||
| #include <cv_bridge/cv_bridge.h> | ||
| #include <tf2/LinearMath/Quaternion.h> | ||
| #include <tf2_ros/buffer.h> | ||
| #include <tf2_ros/transform_listener.h> | ||
|
|
||
| #include <ament_index_cpp/get_package_share_directory.hpp> | ||
| #include <rclcpp/rclcpp.hpp> | ||
|
|
||
| #include <geometry_msgs/msg/pose_array.hpp> | ||
| #include <scene_objects_manager/srv/detect_blocks_poses.hpp> | ||
| #include <sensor_msgs/msg/camera_info.hpp> | ||
| #include <sensor_msgs/msg/image.hpp> | ||
| #include <tf2_geometry_msgs/tf2_geometry_msgs.hpp> | ||
|
|
||
| using DetectBlocksPosesSrv = scene_objects_manager::srv::DetectBlocksPoses; | ||
|
|
||
| namespace sobjmanager { | ||
|
|
||
| class ObjectPoseDetectorNode : public rclcpp::Node { | ||
| public: | ||
| ObjectPoseDetectorNode(); | ||
|
|
||
| private: | ||
| void image_cb(const sensor_msgs::msg::Image::SharedPtr msg); | ||
|
|
||
| void on_detect(const std::shared_ptr<DetectBlocksPosesSrv::Request>, | ||
| std::shared_ptr<DetectBlocksPosesSrv::Response> res); | ||
|
|
||
| void camera_info_cb(const sensor_msgs::msg::CameraInfo::SharedPtr msg); | ||
|
|
||
| rclcpp::Subscription<sensor_msgs::msg::Image>::SharedPtr image_sub_; | ||
| rclcpp::Service<scene_objects_manager::srv::DetectBlocksPoses>::SharedPtr detect_blocks_srv_; | ||
| rclcpp::Subscription<sensor_msgs::msg::CameraInfo>::SharedPtr cam_info_sub_; | ||
|
|
||
| std::mutex mtx_; | ||
| std::optional<cv::Mat> last_rgb_; | ||
| rclcpp::Time last_rgb_stamp_; | ||
| bool camera_info_received_; | ||
| float z_offset_of_block_; | ||
|
|
||
| std::string image_topic_; | ||
| std::string cam_info_topic_; | ||
| std::string cam_frame_; | ||
| std::string output_frame_; | ||
| double aruco_size_; | ||
|
|
||
| cv::Mat camera_matrix_; | ||
| cv::Mat dist_coeffs_; | ||
|
|
||
| std::vector<cv::Vec3d> rvecs_; | ||
| std::vector<cv::Vec3d> tvecs_; | ||
|
|
||
| std::unique_ptr<tf2_ros::Buffer> tf_buffer_; | ||
| std::shared_ptr<tf2_ros::TransformListener> tf_listener_; | ||
| }; | ||
|
|
||
| } // namespace sobjmanager | ||
| #endif // SCENE_OBJECTS_MANAGER__OBJECT_POSE_DETECTOR_HPP_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be perfect to create to lists:
Then use it for:
and for: