-
Notifications
You must be signed in to change notification settings - Fork 581
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
Get robot description from topic in GetUrdfService #2681
Merged
tylerjw
merged 7 commits into
moveit:main
from
Abishalini:pr-get-robot-description-from-topic
Feb 13, 2024
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a06720a
Get robot description from topic
Abishalini be3f741
Update moveit_ros/move_group/src/default_capabilities/get_group_urdf_…
Abishalini 2a726d4
Move subscriber initialization to initialize() function
Abishalini 381f71f
Fix QoS settings
Abishalini 1d441c7
Update error message
Abishalini 0e9179b
Get URDF string from RDF Loader instead
Abishalini 7db923b
Remove unused code
Abishalini 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 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 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.
Should we make sure the topic
robot_description
is available and wait for a given amount of time if not?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.
I tried using this rclcpp function to wait for a certain time until we get a message in the
robot_description
topic. But this causes a timeout error when usingget_urdf
service. Not sure I'm using it wrong.I could add a while loop with a timer to check if the
full_urdf_string_
variable is set.Do you have a better solution to this?
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.
I thought about this a bit more and because you have a moveit_cpp you should be able to get the URDF string like this and not need to manually handle the subscription.
If you add a function to
RDFLoader
to get theurdf_string_
value it contains. Maybe name itgetUrdfString() -> std::string
. Then you can do this:std::string urdf_string = context_ ->moveit_cpp_ ->getPlanningSceneMonitor() ->getRobotModelLoader() ->getRDFLoader() ->getUrdfString();
I know it is ugly, but if you have a moveit_cpp and it is initialized, you should be able to get the string this way, too.
Then you could just add this call to top of the callback for your service and you shouldn't have to subscribe to the topic or read the parameter.