-
Notifications
You must be signed in to change notification settings - Fork 65
[Feature] Pause simulation while dragging interactive markers and via service calls #32
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7b06e06
Simulation pauses while dragging interactive markers
robustify 3be553e
Merge remote-tracking branch 'avidbots/master'
robustify cfe3315
Merge branch 'master' into simulation-pausing
robustify 618a079
Robustness against missing MOUSE_UP; clang; Doxygen and regular comments
robustify 0bb5528
Minor changes to comments.
robustify cc70494
Created pause toggle service and Rviz tool to call it with button press
robustify 07895d8
Merge branch 'pause-service' into simulation-pausing
robustify accf011
Minor variable name and comment changes
robustify 4f853e5
Created pause and resume services; added abstract IsPaused() method.
robustify 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
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
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,46 @@ | ||
| #ifndef PAUSE_SIM_TOOL_H | ||
| #define PAUSE_SIM_TOOL_H | ||
|
|
||
| #include <ros/ros.h> | ||
| #include <rviz/tool.h> | ||
| #include <std_srvs/Empty.h> | ||
|
|
||
| namespace flatland_viz { | ||
|
|
||
| /** | ||
| * @name PauseSimTool | ||
| * @brief Rviz tool to support pausing and unpausing the | ||
| * simulation. | ||
| */ | ||
| class PauseSimTool : public rviz::Tool { | ||
| public: | ||
| PauseSimTool(); | ||
| ~PauseSimTool(); | ||
|
|
||
| private: | ||
| /** | ||
| * @name onInitialize | ||
| * @brief Initializes tools currently loaded when rviz starts | ||
| */ | ||
| virtual void onInitialize(); | ||
|
|
||
| /** | ||
| virtual void activate(); | ||
| * @name activate | ||
| * @brief Call the pause toggle service | ||
| */ | ||
| virtual void activate(); | ||
|
|
||
| /** | ||
| * @name deactivate | ||
| * @brief Cleanup when tool is removed | ||
| */ | ||
| virtual void deactivate(); | ||
|
|
||
| ros::NodeHandle nh_; ///< NodeHandle to call the pause toggle service | ||
| ros::ServiceClient | ||
| pause_service_; ///< ServiceClient that calls the pause toggle service | ||
| }; | ||
| } | ||
|
|
||
| #endif // PAUSE_SIM_TOOL_H |
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.
I think it might be cleaner here to create a SetPaused(bool) method on World and check World::paused_ rather than looking into InteractiveMarkerManager. I'm just wondering how we handle multiple things wishing to pause simulation (e.g. the pause/resume button idea, or some other system that wishes to pause sim).
The actual pause logic here should work fine.