-
Notifications
You must be signed in to change notification settings - Fork 226
Buffer server service #574
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
tonynajjar
wants to merge
25
commits into
ros2:rolling
Choose a base branch
from
pixel-robotics:buffer-server-service
base: rolling
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 19 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
2f8715d
set result_timeout to 0
edebd79
Add TF buffer service
6530c38
Revert "Add TF buffer service"
ae332d2
Add TF buffer service
dd2e8cb
revert timeout
590647b
Revert "set result_timeout to 0"
8a8dec2
Update tf2_msgs/srv/LookupTransform.srv
593692c
Update tf2_msgs/srv/LookupTransform.srv
6d0f679
Update tf2_msgs/srv/LookupTransform.srv
68dfed0
Update tf2_ros/include/tf2_ros/buffer_server.h
d22398c
Update tf2_ros/src/buffer_server.cpp
371691e
Update tf2_ros/src/buffer_server.cpp
bf1c7ea
Update tf2_ros/src/buffer_server.cpp
b92cc63
Update tf2_msgs/srv/LookupTransform.srv
f54674e
Update tf2_ros/include/tf2_ros/buffer_server.h
a8d4613
Update tf2_ros/include/tf2_ros/buffer_server.h
5a38a5e
Merge remote-tracking branch 'upstream/rolling' into buffer-server-se…
e19de6d
simplification
271626c
fix indentation
a7802a7
add python buffer client changes
43085e7
remove action interface
e05f43f
Fix formatting in buffer server code
3770bf7
Remove LookupTransform action and update
f150705
reaname result to response
84cff94
draft of cpp buffer client
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
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,16 @@ | ||
| # Simple API | ||
| string target_frame | ||
| string source_frame | ||
| builtin_interfaces/Time source_time | ||
| builtin_interfaces/Duration timeout | ||
|
|
||
| # Advanced API | ||
| builtin_interfaces/Time target_time | ||
| string fixed_frame | ||
|
|
||
| # Whether or not to use the advanced API | ||
| bool advanced | ||
|
|
||
| --- | ||
| geometry_msgs/TransformStamped transform | ||
| tf2_msgs/TF2Error error |
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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,6 +47,46 @@ | |||||||||||||
|
|
||||||||||||||
| namespace tf2_ros | ||||||||||||||
| { | ||||||||||||||
|
|
||||||||||||||
| void BufferServer::serviceCB( | ||||||||||||||
| const std::shared_ptr<LookupTransformService::Request> request, | ||||||||||||||
| std::shared_ptr<LookupTransformService::Response> response) | ||||||||||||||
| { | ||||||||||||||
| // TODO: implement retrying + timeout | ||||||||||||||
| try { | ||||||||||||||
| // check whether we need to use the advanced or simple api | ||||||||||||||
| if (request->advanced) { | ||||||||||||||
| response->transform = buffer_.lookupTransform( | ||||||||||||||
| request->target_frame, tf2_ros::fromMsg(request->target_time), | ||||||||||||||
| request->source_frame, tf2_ros::fromMsg(request->source_time), request->fixed_frame); | ||||||||||||||
| } | ||||||||||||||
| else { | ||||||||||||||
clalancette marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||
| response->transform = buffer_.lookupTransform( | ||||||||||||||
| request->target_frame, request->source_frame, | ||||||||||||||
| tf2_ros::fromMsg(request->source_time)); | ||||||||||||||
clalancette marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| } catch (const tf2::ConnectivityException & ex) { | ||||||||||||||
| response->error.error = response->error.CONNECTIVITY_ERROR; | ||||||||||||||
| response->error.error_string = ex.what(); | ||||||||||||||
| } catch (const tf2::LookupException & ex) { | ||||||||||||||
| response->error.error = response->error.LOOKUP_ERROR; | ||||||||||||||
| response->error.error_string = ex.what(); | ||||||||||||||
| } catch (const tf2::ExtrapolationException & ex) { | ||||||||||||||
| response->error.error = response->error.EXTRAPOLATION_ERROR; | ||||||||||||||
| response->error.error_string = ex.what(); | ||||||||||||||
| } catch (const tf2::InvalidArgumentException & ex) { | ||||||||||||||
| response->error.error = response->error.INVALID_ARGUMENT_ERROR; | ||||||||||||||
| response->error.error_string = ex.what(); | ||||||||||||||
| } catch (const tf2::TimeoutException & ex) { | ||||||||||||||
| response->error.error = response->error.TIMEOUT_ERROR; | ||||||||||||||
| response->error.error_string = ex.what(); | ||||||||||||||
| } catch (const tf2::TransformException & ex) { | ||||||||||||||
| response->error.error = response->error.TRANSFORM_ERROR; | ||||||||||||||
| response->error.error_string = ex.what(); | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| void BufferServer::checkTransforms() | ||||||||||||||
| { | ||||||||||||||
| std::unique_lock<std::mutex> lock(mutex_); | ||||||||||||||
|
|
@@ -145,6 +185,8 @@ rclcpp_action::CancelResponse BufferServer::cancelCB(GoalHandle gh) | |||||||||||||
| rclcpp_action::GoalResponse BufferServer::goalCB( | ||||||||||||||
| const rclcpp_action::GoalUUID & uuid, std::shared_ptr<const LookupTransformAction::Goal> goal) | ||||||||||||||
| { | ||||||||||||||
| RCLCPP_WARN_ONCE(logger_, "You are using the deprecated action interface of the tf2_ros::BufferServer. \ | ||||||||||||||
| Please use the service interface instead."); | ||||||||||||||
|
||||||||||||||
| RCLCPP_WARN_ONCE(logger_, "You are using the deprecated action interface of the tf2_ros::BufferServer. \ | |
| Please use the service interface instead."); | |
| RCLCPP_WARN_ONCE( | |
| logger_, | |
| "You are using the deprecated action interface of the tf2_ros::BufferServer. " | |
| "Please use the service interface instead."); |
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.
Uh oh!
There was an error while loading. Please reload this page.