Skip to content
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

Add trigger service to enable/disable the standalone node #43

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

renan028
Copy link
Collaborator

Adding a service to stop the node for obstacle computation (costmap is still updated).

@renan028 renan028 requested a review from corot September 20, 2024 04:41
} else {
enabled_ = false;
response.success = true;
response.message = "costmap converter stopped.";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not disabled? (or started above)

@corot corot requested a review from siferati November 8, 2024 00:55
Comment on lines +298 to +307
if (request.data) {
enabled_ = true;
response.success = true;
response.message = "costmap converter enabled.";
} else {
enabled_ = false;
response.success = true;
response.message = "costmap converter stopped.";
}
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (request.data) {
enabled_ = true;
response.success = true;
response.message = "costmap converter enabled.";
} else {
enabled_ = false;
response.success = true;
response.message = "costmap converter stopped.";
}
return true;
if (request.data) {
response.message = "costmap converter enabled.";
} else {
response.message = "costmap converter stopped.";
}
enabled_ = request.data;
response.success = true;
return true;

S: less duplication

@@ -85,13 +85,17 @@ class CostmapStandaloneConversion
costmap_update_sub_ = n_.subscribe(costmap_update_topic, 1, &CostmapStandaloneConversion::costmapUpdateCallback, this);
obstacle_pub_ = n_.advertise<costmap_converter::ObstacleArrayMsg>(obstacles_topic, 1000);
marker_pub_ = n_.advertise<visualization_msgs::Marker>(polygon_marker_topic, 10);
trigger_ = n_.advertiseService("enable", &CostmapStandaloneConversion::triggerCb, this);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S: dynamic reconfigure parameter instead of service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants