-
Notifications
You must be signed in to change notification settings - Fork 545
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
[Servo] Improve support for switching planning group #2333
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
da1e351
Add PAUSED status
ibrahiminfinite 2617460
Add setStatus() method
ibrahiminfinite bee7b76
Make updateParams public + update only when paused
ibrahiminfinite 4cc5705
Make robot state a member variable
ibrahiminfinite 5daf8c2
Make joint model group a member variable
ibrahiminfinite c91feee
Make joint names a member variable
ibrahiminfinite 466b286
Get number of joint from joint names
ibrahiminfinite 824c1c2
Allow updating planning group
ibrahiminfinite 3bf17df
set servo status in pause service
ibrahiminfinite 3dd18b1
Reload smoothing plugin on planning group change
ibrahiminfinite 58f6fbc
Always load the smoothing plugin but use based on the parameter
ibrahiminfinite 5d21659
Initialize smoothing plugin withing try block
ibrahiminfinite 3998cf5
Better handling for paramter updates
ibrahiminfinite 19b7c1f
Use flag for invalid update
ibrahiminfinite 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +96,12 @@ class Servo | |
*/ | ||
StatusCode getStatus() const; | ||
|
||
/** | ||
* \brief Set the current status of servo to the provided status. | ||
* @param status The new status of servo. | ||
*/ | ||
void setStatus(const StatusCode status); | ||
|
||
/** | ||
* \brief Get the message associated with the current servo status. | ||
* @return The status message. | ||
|
@@ -122,14 +128,19 @@ class Servo | |
* \brief Get the current state of the robot as given by planning scene monitor. | ||
* @return The current state of the robot. | ||
*/ | ||
KinematicState getCurrentRobotState() const; | ||
KinematicState getCurrentRobotState(); | ||
|
||
/** | ||
* \brief Smoothly halt at a commanded state when command goes stale. | ||
* @param The last commanded joint states. | ||
* @return The next state stepping towards the required halting state. | ||
*/ | ||
std::pair<bool, KinematicState> smoothHalt(const KinematicState& halt_state) const; | ||
std::pair<bool, KinematicState> smoothHalt(const KinematicState& halt_state); | ||
|
||
/** | ||
* \brief Updates the servo parameters and performs validations. | ||
*/ | ||
bool updateParams(); | ||
|
||
private: | ||
/** | ||
|
@@ -139,7 +150,7 @@ class Servo | |
* @param command_frame The command frame name. | ||
* @return The transformation between planning frame and command frame. | ||
*/ | ||
Eigen::Isometry3d getPlanningToCommandFrameTransform(const std::string& command_frame) const; | ||
Eigen::Isometry3d getPlanningToCommandFrameTransform(const std::string& command_frame); | ||
|
||
/** | ||
* \brief Convert a given twist command to planning frame, | ||
|
@@ -150,21 +161,21 @@ class Servo | |
* @param command The twist command to be converted. | ||
* @return The transformed twist command. | ||
*/ | ||
TwistCommand toPlanningFrame(const TwistCommand& command) const; | ||
TwistCommand toPlanningFrame(const TwistCommand& command); | ||
|
||
/** | ||
* \brief Convert a given pose command to planning frame | ||
* @param command The pose command to be converted | ||
* @return The transformed pose command | ||
*/ | ||
PoseCommand toPlanningFrame(const PoseCommand& command) const; | ||
PoseCommand toPlanningFrame(const PoseCommand& command); | ||
|
||
/** | ||
* \brief Compute the change in joint position required to follow the received command. | ||
* @param command The incoming servo command. | ||
* @return The joint position change required (delta). | ||
*/ | ||
Eigen::VectorXd jointDeltaFromCommand(const ServoInput& command, const moveit::core::RobotStatePtr& robot_state); | ||
Eigen::VectorXd jointDeltaFromCommand(const ServoInput& command); | ||
|
||
/** | ||
* \brief Updates data depending on joint model group | ||
|
@@ -178,11 +189,6 @@ class Servo | |
*/ | ||
bool validateParams(const servo::Params& servo_params) const; | ||
|
||
/** | ||
* \brief Updates the servo parameters and performs validations. | ||
*/ | ||
bool updateParams(); | ||
|
||
/** | ||
* \brief Create and initialize the smoothing plugin to be used by servo. | ||
*/ | ||
|
@@ -214,6 +220,12 @@ class Servo | |
std::unique_ptr<CollisionMonitor> collision_monitor_; | ||
|
||
pluginlib::UniquePtr<online_signal_smoothing::SmoothingBaseClass> smoother_ = nullptr; | ||
|
||
moveit::core::RobotStatePtr robot_state_; | ||
const moveit::core::JointModelGroup* joint_model_group_; | ||
std::vector<std::string> joint_names_; | ||
|
||
bool invalid_parameter_update_; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need this if it's used as synonymous with servo being paused. I also can't find that line in the PR review, but I think your changes make you able to remove the |
||
}; | ||
|
||
} // namespace moveit_servo |
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.
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.
Why is this not
const
if it just gets the robot state variable?This is impacting the constness of a bunch of other functions as well