-
Notifications
You must be signed in to change notification settings - Fork 796
Description
Checklist
- I've read the contribution guidelines.
- I've searched other issues and no duplicate issues were found.
- I'm convinced that this is not my fault but a bug.
Description
There is a logical bug in the ExternalVelocityLimitSelectorNode implementation:
-
When a velocity limit clear command is received,
onVelocityLimitClearCommandcallsclearVelocityLimit, thengetCurrentVelocityLimitandpublishVelocityLimit. -
If
velocity_limit_table_is empty,clearVelocityLimitreturns early and does not callupdateVelocityLimit(). -
This means
hardest_limit_is not updated, and subsequent calls togetCurrentVelocityLimit()may return invalid or stale data.
Expected behavior
After a clear command (even when the table is empty), the node should always update its internal state and publish a valid/default velocity limit.
Actual behavior
When a clear command is send before any velocity limit command, an undefined value will be published as the external velocity limit. In RVIZ the speed limit is immediately set to 0 km/h.
Steps to reproduce
- Start the planning simulation with the external_velocity_limit_selector.
- Do not send any external velocity limit
- Send a clear command (VelocityLimitClearCommand). E.g. via Terminal:
ros2 topic pub -1 /planning/scenario_planning/clear_velocity_limit tier4_planning_msgs/msg/VelocityLimitClearCommand "{command: true, sender: "examplesender"}" - Observe that the published velocity limit may be inconsistent or default-initialized.
Versions
No response
Possible causes
The undefined state of the hardest_limit_ can be avoided, if updateVelocityLimit() is always called. My proposal to fix this is:
void ExternalVelocityLimitSelectorNode::clearVelocityLimit(const std::string & sender)
{
if (velocity_limit_table_.empty()) {
RCLCPP_WARN(get_logger(), "no velocity limit has been set from internal.");
updateVelocityLimit(); // <-- this should be added, so the limit is always updated, even if the table is empty
return;
}
velocity_limit_table_.erase(sender);
updateVelocityLimit();
}
Additional context
This bug was found together with the EDGAR team (especially @korbinianmoller and @tmasc31) while working on an integration of electronic speed limit signs for the EDGAR Demo rides at IAA 2025.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status