Skip to content

Commit

Permalink
Remove concept of 'name' / 'track_name' from Track
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackerman342 committed Oct 25, 2023
1 parent 0948c34 commit 96a8842
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
22 changes: 9 additions & 13 deletions protos/farm_ng/control/control.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,30 @@ package farm_ng.control.proto;

// A track is a sequence of waypoints that the robot should follow or already drove.
message Track {
// The name of the track
string name = 1;
// The waypoints along the track
repeated farm_ng.core.proto.Pose waypoints = 2;
repeated farm_ng.core.proto.Pose waypoints = 1;
}

// This is sent to the controller service by a client to request a track be followed.
message TrackFollowRequest {
// The track to follow
Track track = 1;
// Whether to drive the robot along the track in reverse or not.
// This means negative velocity and is independent of driving the waypoints in reverse order.
// See: track_reversed in TrackFollowerStatus
bool reverse_driving = 2;
// Optional requests for the controller to follow the track in a specific way.
// If no modes are specified, default track following behavior is used.
// If modes are specified, but not possible, track following will fail.
repeated TrackFollowMode modes = 2;
}

// The complete state of the controller.
message TrackFollowerState {
// The name of the track being followed
string track_name = 1;
// Status of the controller
TrackFollowerStatus status = 2;
TrackFollowerStatus status = 1;
// Progress along the track
TrackFollowerProgress progress = 3;
TrackFollowerProgress progress = 2;
// Poses of the robot and relevant points along the track
TrackFollowerPoseTree poses = 4;
TrackFollowerPoseTree poses = 3;
// The commanded velocity in the robot's egocentric frame
farm_ng.core.proto.Isometry3F64Tangent commands = 5;
farm_ng.core.proto.Isometry3F64Tangent commands = 4;
}

// Status metrics of the controller
Expand Down
2 changes: 1 addition & 1 deletion py/examples/controller_square/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def format_track(track_waypoints: list[Pose3F64]) -> Track:
Args:
track_waypoints (list[Pose3F64]): The track waypoints.
"""
return Track(name="my_custom_track", waypoints=[pose.to_proto() for pose in track_waypoints])
return Track(waypoints=[pose.to_proto() for pose in track_waypoints])


async def main(service_config_path: Path, side_length: float, clockwise: bool) -> None:
Expand Down
2 changes: 1 addition & 1 deletion py/examples/record_track/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def main(service_config_path: Path, track_name: str, output_dir: Path) ->
await EventClient(config).request_reply("/clear_track", Empty())

# Create a Track message to store the waypoints in
track: Track = Track(name=track_name)
track: Track = Track()

# Subscribe to the filter track topic
message: Pose
Expand Down
2 changes: 1 addition & 1 deletion py/farm_ng/control/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def filter_track_to_track(filter_track: FilterTrack) -> Track:
"""
if not isinstance(filter_track, FilterTrack):
raise TypeError(f"Expected FilterTrack, got {type(filter_track)}")
return Track(name=filter_track.name, waypoints=[state.pose for state in filter_track.states])
return Track(waypoints=[state.pose for state in filter_track.states])


def update_filter_track(track_path: Path) -> None:
Expand Down

0 comments on commit 96a8842

Please sign in to comment.