navigation
DriveSegment
dataclass
¶
DriveSegment(
*, use_implement: bool = False, stop_at_end: bool = True
)
Bases: PathSegment
A path segment with implement usage and stop behavior configuration.
GnssRequirement ¶
Bases: StrEnum
Minimum GPS quality required when recording waypoints.
is_met_by ¶
is_met_by(gps_quality: GpsQuality | None) -> bool
Check whether the given GPS quality meets this requirement.
Events¶
| Name | Description |
|---|---|
RECORDED_TRACKS_CHANGED |
The selected track has changed. |
RecordedTrack ¶
RecordedTrack(name: str | None = None)
A track (basically a list of waypoints) that can be recorded and later navigated along.
add_waypoint ¶
add_waypoint(
waypoint: GeoPose, approach_reverse: bool = False
) -> None
Add a waypoint to the end of the list.
get_waypoint ¶
get_waypoint(index: int) -> RecordedWaypoint
Get the waypoint at the given index, raising IndexError if out of bounds.
meets_gnss_requirement ¶
meets_gnss_requirement(
gps_quality: GpsQuality | None,
) -> bool
Check whether the given GPS quality meets this track's minimum requirement.
move_waypoint ¶
move_waypoint(from_index: int, to_index: int) -> None
Move a waypoint from one position to another.
set_waypoint_approach_reverse ¶
set_waypoint_approach_reverse(
index: int, approach_reverse: bool
) -> None
Set whether to approach the waypoint at the given index in reverse.
set_waypoint_stop_at_waypoint ¶
set_waypoint_stop_at_waypoint(
index: int, stop_at_waypoint: bool
) -> None
Set whether to stop at this waypoint.
set_waypoint_use_implement ¶
set_waypoint_use_implement(
index: int, use_implement: bool
) -> None
Set whether to allow implement usage on the segment leading to this waypoint.
Attributes & Properties¶
| Name | Type | Description |
|---|---|---|
first_waypoint |
feldfreund_devkit.navigation.recorded_track.RecordedWaypoint | None |
Get the first waypoint. |
last_waypoint |
feldfreund_devkit.navigation.recorded_track.RecordedWaypoint | None |
Get the last waypoint. |
waypoints |
list |
Get the waypoints. |
Events¶
| Name | Description |
|---|---|
RECORDED_TRACKS_CHANGED |
The selected track has changed. |
RecordedTrackNavigation ¶
RecordedTrackNavigation(
*,
recorded_track_provider: RecordedTrackProvider,
track_recording_controller: TrackRecordingController,
gnss: Gnss | None = None,
automator: Automator | None = None,
robot_marker_icon_url: str | None = None,
**kwargs
)
Bases: WaypointNavigation
Drives along a previously recorded track of waypoints.
approach_start
async
¶
approach_start() -> None
Approaches the start of the track directly.
Use with caution, alignment with the track will not be checked. If reverse is enabled, the robot will approach the end of the track instead.
Attributes & Properties¶
| Name | Type | Description |
|---|---|---|
current_segment |
feldfreund_devkit.navigation.drive_segment.DriveSegment | None |
Returns the current segment to drive along or None if there are no waypoints left. |
has_waypoints |
bool |
Returns True as long as there are waypoints to drive to. |
path |
list |
Returns the whole planned path. |
RecordedTrackProvider ¶
RecordedTrackProvider()
Bases: Persistable
A provider of recorded waypoints.
selected_track
instance-attribute
¶
selected_track: RecordedTrack | None = None
The recorded tracks have changed.
add_recorded_track ¶
add_recorded_track(track: RecordedTrack) -> None
Add a recorded track to the list.
get_recorded_track ¶
get_recorded_track(track_id: str) -> RecordedTrack | None
Get the recorded track by ID.
notify_track_modified ¶
notify_track_modified() -> None
Persist changes to an existing track (e.g. waypoint added/removed/moved, name changed).
remove_recorded_track ¶
remove_recorded_track(track_id: str) -> None
Remove a recorded track from the list.
restore_from_dict ¶
restore_from_dict(data: dict[str, Any]) -> None
Restore the recorded tracks from a dictionary.
Events¶
| Name | Description |
|---|---|
RECORDED_TRACKS_CHANGED |
The selected track has changed. |
RecordedWaypoint
dataclass
¶
RecordedWaypoint(
*,
pose: GeoPose,
approach_reverse: bool = False,
use_implement: bool = False,
stop_at_waypoint: bool = False
)
A waypoint with optional drive settings flags.
Events¶
| Name | Description |
|---|---|
RECORDED_TRACKS_CHANGED |
The selected track has changed. |
StraightLineNavigation ¶
StraightLineNavigation(**kwargs)
Attributes & Properties¶
| Name | Type | Description |
|---|---|---|
current_segment |
feldfreund_devkit.navigation.drive_segment.DriveSegment | None |
Returns the current segment to drive along or None if there are no waypoints left. |
has_waypoints |
bool |
Returns True as long as there are waypoints to drive to. |
path |
list |
Returns the whole planned path. |
TrackRecordingController ¶
TrackRecordingController(
recorded_track_provider: RecordedTrackProvider,
*,
pose_provider: PoseProvider,
gnss: Gnss | None = None
)
Server-side recording mode that survives client disconnects.
Owns the bluetooth-app waypoint button so the operator can keep adding waypoints even if the browser/dialog is gone.
The app button bar (app_controls) is bound late: it is created by the
application after this controller and only on real hardware, so it stays
None until assigned and the button registration is skipped while absent.
add_waypoint_at_current_pose
async
¶
add_waypoint_at_current_pose() -> None
Append the robot's current pose as a waypoint to the active track.
Returns without adding if not recording or if the GNSS quality is
insufficient. The GNSS case notifies the operator (forwarded to both
browser clients and the bluetooth app via rosys.NEW_NOTIFICATION).
start_recording
async
¶
start_recording(track: RecordedTrack) -> bool
Start a recording session. Returns False if a session is already active.
Persists the track immediately (so it survives a server crash) without
emitting RECORDED_TRACKS_CHANGED — that event refreshes the settings UI
which would tear down a dialog opened from there. Stop emits it instead.
WaypointNavigation ¶
WaypointNavigation(
*,
implement: Implement,
driver: Driver,
pose_provider: PoseProvider,
name: str = "Waypoint Navigation"
)
Bases: Persistable
Base class for all waypoint based navigation types.
_drive_along_segment
async
¶
_drive_along_segment(
*, linear_speed_limit: float = 0.3
) -> None
Drive the robot to the next waypoint of the navigation
_follow_segment_until
async
¶
_follow_segment_until(target: Point) -> bool
Drives to a target point along the current spline.
:param target: The target point to drive to
_remove_segments_behind_robot ¶
_remove_segments_behind_robot(
path_segments: list[DriveSegment],
*,
completed_percentage: float = 0.99
) -> list[DriveSegment]
Create new path(list of segments) starting at the closest segment to the current pose
prepare
async
¶
prepare() -> bool
Prepares the navigation for the start of the automation
Returns true if all preparations were successful, otherwise false.
Attributes & Properties¶
| Name | Type | Description |
|---|---|---|
current_segment |
feldfreund_devkit.navigation.drive_segment.DriveSegment | None |
Returns the current segment to drive along or None if there are no waypoints left. |
has_waypoints |
bool |
Returns True as long as there are waypoints to drive to. |
path |
list |
Returns the whole planned path. |
Events¶
| Name | Description |
|---|---|
PATH_GENERATED |
a new path has been generated(argument: list[DriveSegment]) |
SEGMENT_STARTED |
a waypoint has been reached |
SEGMENT_COMPLETED |
a waypoint has been reached |
PATH_COMPLETED |
the entire path with all its waypoints has been completed |