Maritime-Robotics-Student-Society / sailing-robot

Southampton sailing robot
http://www.sotonsailrobot.org
Other
88 stars 46 forks source link

Jibe if tack fails #180

Closed Nanoseb closed 7 years ago

Nanoseb commented 7 years ago

Force the boat to jibe when a tack fails.

I did a first implementation of that, but it was not used because quite dumb and could lead to more issues than without (it just creates a wp behind the boat).

The idea would be to make a 'real' jibe like it is done when the jibe_to_turn parameter is set to true.

Nanoseb commented 7 years ago

@takluyver at the moment your task manager can't subscribe to topics right? Do you think this can be done easily?

Here to implement this I want to have a node that time the duration of the tack and if it is too long it publish something to say to your class to jibe instead. Do you think that is the good approach?

EDIT: ok what I can do is like what you did for the obstacle_avoidance, so that it doesn't change much things, I'll make a pr with that once done

takluyver commented 7 years ago

The task manager handles a sequence of tasks (e.g. go to waypoint, or linger at waypoint), each of which has ways to calculate:

  1. What should I do now?
  2. Is this task finished? (when it is, the task manager will go on to the next one)

The manager has a Python API to insert a temporary task, do that and resume the task it was doing before. This is what it does with waypoints published on the temporary_wp topic. We could make a task type like 'jibe', or 'head downwind for 5 seconds', and then have it listen to another topic to trigger inserting such a task. I think that's simpler than something based on the obstacle avoidance waypoints, which is a specific kind of task.

Nanoseb commented 7 years ago

Oh yes ok, that'll be cleaner, thanks

Nanoseb commented 7 years ago

it is in progress, see branch force_jibe

takluyver commented 7 years ago

The implementation seems to work, though we might increase the timeout a bit for low wind conditions.

We also discussed yesterday using the proposed sensor-fusion speed estimates to delay tacking while the boat gains sufficient speed to make a tack, and to make decisions about when to jibe.