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

Added dynamic Replanning #18

Open
wants to merge 5 commits into
base: traj_gen
Choose a base branch
from
Open

Conversation

Debjoy10
Copy link
Collaborator

@Debjoy10 Debjoy10 commented Aug 2, 2020

Adding noise in velocity commands to simulate drift for first 1-2 iters.
(May have to modify threshold drift to suit simulation)

@Debjoy10
Copy link
Collaborator Author

Debjoy10 commented Aug 2, 2020

Thoda drift hai still, I think due to the motion in the idle time when the path is recomputed.

start_drift = 100

print("Computing Path ...")
path_o, vel = get_trajectory(waypoints, gate_length, gate_height, pos0, ts, 4)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Replan also considering that initial velocity and acc is not zero

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done


drift = (pos0[0]-px)**2 + (pos0[1]-py)**2 + (pos0[2]-pz)**2
if drift > max(start_drift, 10) and i > 5:
print("Drift Increasing, Replan!")
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be better to have replan and drift monitoring in a different thread like a watchdog.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can you explain more

Copy link
Collaborator

Choose a reason for hiding this comment

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

Low priority. Basically, monitor drift in a different thread and replan without blocking initial loop kinda.

@archit120
Copy link
Collaborator

Also, remove unneeded CEM files?

# Initial

waypoints, gate_length, gate_height = get_dummy_waypoints(client)
waypoints = get_fixed_points.get_points_modif(waypoints)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Point need to be recalculated too as the initial position of drone is now different.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

waypoints are getting updated in the loop

@archit120
Copy link
Collaborator

archit120 commented Aug 2, 2020

It doesn't work really well right now. Too many changes needed.

@Debjoy10
Copy link
Collaborator Author

Debjoy10 commented Aug 2, 2020

Check how this version works on the simulator and revert.

@Debjoy10 Debjoy10 requested a review from archit120 August 2, 2020 15:17
@archit120
Copy link
Collaborator

Drift calculation is a bit weird. It sometime doesn't replan till a lot of drift and sometimes replan with very little drift. Also, why is replanning so explicit? The vehicle stops and then restarts kinda. Need to fix somehow. Maybe when replanning, consider velocity and position sometime in future as initial? A better solution would be to replan in a parallel thread so that movement isn't affected.

A temporary solution is to set simpause when replanning.

@Debjoy10
Copy link
Collaborator Author

Debjoy10 commented Aug 2, 2020

@archit120

  1. In the time when it is calculating the path, no velocity commands are being given, so I think it goes into hover? And that's probably why it stops.
  2. There are a max drift and a minimum timestep condition in the breaking loop. Whatever the drift is it will not replan before moving 5 timesteps in current trajectory. This is given due to-
    a. Initial simulated drift is invisible without it.
    b. With no minimum timestep, it continuously replans, not giving the drone any chance to start moving on the correct path.
  3. Yeah, sim pause can be a temporary solution.
  4. Looking into the parallel thread stuff now.

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.

2 participants