AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

Can I draw a line when I run the UE4

Open EricJin101 opened this issue 8 years ago • 29 comments

screenshot from 2018-09-13 17-14-55 As the picture shows...

EricJin101 avatar Sep 13 '18 09:09 EricJin101

I need to display the global path in UE, how can I make it?

EricJin101 avatar Sep 13 '18 09:09 EricJin101

If you edit BP_FlyingPawn to include a draw debug line node you should get the result shown in the picture. Here is what I used in my project: image

DavidLSmyth avatar Sep 13 '18 10:09 DavidLSmyth

If you edit BP_FlyingPawn to include a draw debug line node you should get the result shown in the picture. Here is what I used in my project: image

What I really wanted to show was that once I had the planned trajectory I could visualize it on the AirSim directly, similar to the way one can in rviz.

EricJin101 avatar Sep 17 '18 08:09 EricJin101

Your question seems pretty vague. If you want to view a planned trajectory you could just run the simulation with the clock significantly sped up? As far as I know there is no way to visualise a planned trajectory without running the game as the simulator will start when the game runs, and the simulator is what estimates the state of the vehicles (simulator code here)

DavidLSmyth avatar Sep 17 '18 15:09 DavidLSmyth

I updated the api to visualise planned waypoints. I made the changes to worldSimApi, similar to how the printLogMessage functionality was added. I can submit a pull request if this would be useful to add to the api. image

DavidLSmyth avatar Oct 16 '18 13:10 DavidLSmyth

thank you! it will be extremely useful! I believe it is the exactly API I want.

EricJin101 avatar Oct 16 '18 15:10 EricJin101

I updated the api to visualise planned waypoints. I made the changes to worldSimApi, similar to how the printLogMessage functionality was added. I can submit a pull request if this would be useful to add to the api. image

thanks a lot! It's really useful

EricJin101 avatar Oct 17 '18 08:10 EricJin101

I have it in my fork: https://github.com/DavidLSmyth/AirSim/ Changes are:

  • You can now draw debug lines relative to a vehicle or to the 0,0,0 coordinate in the environment
  • There is an option to turn a debug tracing line on for the RAV which tracks its path.

Examples can be found in takeoff.py, new methods are showPlannedWaypoints and simShowDebugLines.

It's slightly messy at the moment as I had some trouble figuring out how to use Vector3r with RPC but I will fix that soon.

DavidLSmyth avatar Oct 17 '18 14:10 DavidLSmyth

I have it in my fork: https://github.com/DavidLSmyth/AirSim/ Changes are:

* You can now draw debug lines relative to a vehicle or to the 0,0,0 coordinate in the environment

* There is an option to turn a debug tracing line on for the RAV which tracks its path.

Examples can be found in takeoff.py, new methods are showPlannedWaypoints and simShowDebugLines.

It's slightly messy at the moment as I had some trouble figuring out how to use Vector3r with RPC but I will fix that soon.

I got an error... /vehicles/multirotor/api/MultirotorApiBase.cpp:7:10: fatal error: 'DrawDebugHelpers.h' file not found #include "DrawDebugHelpers.h"

EricJin101 avatar Oct 19 '18 02:10 EricJin101

What unreal engine version and OS are you using? It's included in multiple files that existed before I made changes so strange that it's only showing that error now image

I'm developing on windows 10, visual studio 2017, unreal engine 4.18 so there may be compatibility issues.

DavidLSmyth avatar Oct 19 '18 09:10 DavidLSmyth

What unreal engine version and OS are you using? It's included in multiple files that existed before I made changes so strange that it's only showing that error now image

I'm developing on windows 10, visual studio 2017, unreal engine 4.18 so there may be compatibility issues.

sorry for the reply is not timely, I'm developing on Ubuntu 16.04, and UE is 4.20, my computer broke down last weekend... I will try it again this week

EricJin101 avatar Oct 22 '18 07:10 EricJin101

I have it in my fork: https://github.com/DavidLSmyth/AirSim/ Changes are:

* You can now draw debug lines relative to a vehicle or to the 0,0,0 coordinate in the environment

* There is an option to turn a debug tracing line on for the RAV which tracks its path.

Examples can be found in takeoff.py, new methods are showPlannedWaypoints and simShowDebugLines. It's slightly messy at the moment as I had some trouble figuring out how to use Vector3r with RPC but I will fix that soon.

I got an error... /vehicles/multirotor/api/MultirotorApiBase.cpp:7:10: fatal error: 'DrawDebugHelpers.h' file not found #include "DrawDebugHelpers.h" Hello, I have encountered this problem, have you solved it?

yuzw213 avatar Oct 24 '18 11:10 yuzw213

Where is this file "drawdebughelpers.h" from?UE4?So how do you compile airsim?

yuzw213 avatar Oct 24 '18 11:10 yuzw213

@ZWYDeveloper I am on a business trip, sadly, I didn't figure it out yet..

EricJin101 avatar Oct 24 '18 12:10 EricJin101

I realised that include isn't necessary, just updated my fork to remove it. I have ubuntu on another partition so can have a look if there are more problems

DavidLSmyth avatar Oct 24 '18 12:10 DavidLSmyth

@DavidLSmyth Yes, I succeeded, I send this file before compilation airsim commented out, put the compiled plug-in ue4 compilation in the scene and then opens, the effect of this is I compiled, is nice, but I want to optimize the trajectory of the lines, I need to take a look at you to modify the API, thank you for your open source share, thank you!

yuzw213 avatar Oct 25 '18 06:10 yuzw213

image tim 20181025142432

yuzw213 avatar Oct 25 '18 06:10 yuzw213

@DavidLSmyth Yes, I succeeded, I send this file before compilation airsim commented out, put the compiled plug-in ue4 compilation in the scene and then opens, the effect of this is I compiled, is nice, but I want to optimize the trajectory of the lines, I need to take a look at you to modify the API, thank you for your open source share, thank you!

The changes were pretty straightforward, they are all contained in one commit. Happy to help!

DavidLSmyth avatar Oct 25 '18 09:10 DavidLSmyth

Internal VSTF 7413.

RVBldr avatar Nov 21 '18 17:11 RVBldr

@DavidLSmyth Thank you for sharing your addition to path plotting. I had an error withself.simShowPawnPath(True, 3, 8,vehicle_name) as follows msgpackrpc.error.RPCError: rpclib: server could not find function 'simShowPawnPath' with argument count 4. I have installed your airsim fork to make sure I don't miss anything. Also do I still need to edit BP_FlyingPawn ?

AloshkaD avatar Dec 26 '18 04:12 AloshkaD