Open p3jawors opened 4 years ago
I just wanted to update my figure, as I have sorted out my issue with dg
being different than the other velocity signals, and to provide a tldr for the above...
Why do the linear and angular velocity feedback signals not match the rate of change of the position and orientation signals?
green: airsim feedback
yellow: np.gradient(position)
for linear velocity and np.gradient(euler_angles)
for angular velocity
red: airsim feedback * 2
The velocity feedback * 2 is very close to the derivatives of position and orientation, however, that could just be coincidence. Also, I can confirm I am using the right timestep size for my differentiation.
Is there any update on this? I'm still getting innacurate velocity feedback when compared to the derivative of position feedback. Any insight to this problem is greatly appreciated.
I came across this problem again when I tried changing my simulator timestep from 10ms to 1ms. It appears that Airsim is not accounting for timestep when providing velocity feedback. I've attached a plot showing the linear and angular velocity feedback from airsim (along rows) plotted against different timesteps (along columns). There is a clear increase in the scale of the feedback as the timestep increases. The dotted lines label grad
are the np.gradient(0th_state, dt)
, so for the dx
row, it will be the gradient of x_position
.
The difference between timesteps is a bit clearer when plotted on a single subplot for differing timesteps.
For the time being I've used the ratio of the actual/expected and interpolated a linear function to set a scaling factor, given the timestep. Any insights on this are greatly appreciated, as I can not find anything relevant in the documentation or previous issues.
Is this a dead issue as I haven't gotten a single response in half a year? Unless I'm mistaken, the velocity feedback is quite wrong depending on sim timesteps. I have an empircal solution for now that scales the velocity given the timestep, but this is far from an ideal solution.
This issue has been automatically marked as stale because it has not had activity from the community in the last year. It will be closed if no further activity occurs within 20 days.
This is still an issue on my end, has there been any word on taking a look at, or trying to recreate these results?
:cry:
python==3.5.2 airsim==1.2.7 unreal==4.24.1-0+++UE4+Release-4.24 OS: Ubuntu 16.04
I am currently trying to implement my own PD controller for the multirotor and have been having issues with the gain tuning. Comparing my planned target positions and velocities I would be overshooting position while undershooting the target velocity, which didn't make any sense. If I take the gradient of my path planner's position with my set
dt
I get my expected velocity profile, so the issue is not with the path planner. This led me to look into the derivative of the position feedback.For a little background, I am controlling the drone's motor's PWMs in synchronous mode with...
moveByMotorPWMsAsync(pwm[0], pwm[1], pwm[2], pwm[3], dt).join()
I get feedback with...
If I plot my planned target positions and velocities against the drone feedback for a run, then compare those feedback velocities with
np.gradient(pos, dt)
(pos recorded for an entire flight) I get much higher velocities (very close to x2 as big) with the gradient, compared to the feedback. This make much more sense with what I am observing between position and velocity of my drone and path planner. I am also setting a spherical object's state with this path planner and can confirm that it goes from start to target, and that the drone is moving faster than it.I have attached a plot showing:
np.gradient(pos, dt)
on linear velocity subplots and for angular velocity I do the same, but with the quaternion feedback converted torxyz
euler angles for the gradient calculationIs there something I could be missing or some mistake I am making in getting my velocity feedback? It might just be a coincidence, but if I scale the feedback velocity by 2 is almost perfectly matches the gradient of position, except for
dg
which is different.I thought this could be an issue with commands being run asynchronously, but with how I understand the docs I believe I am correctly setting my pwm commands to run in synchronous mode by passing in
dt
forduration
and appending the.join()
command.