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

Can I draw a line when I run the UE4 #1393

Closed
EricJin101 opened this issue Sep 13, 2018 · 29 comments
Closed

Can I draw a line when I run the UE4 #1393

EricJin101 opened this issue Sep 13, 2018 · 29 comments

Comments

@EricJin101
Copy link

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

@EricJin101
Copy link
Author

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

@EricJin101 EricJin101 changed the title Can I draw the line when I run the UE4 Can I draw a line when I run the UE4 Sep 13, 2018
@DavidLSmyth
Copy link

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

@EricJin101
Copy link
Author

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.

@DavidLSmyth
Copy link

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
Copy link

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

@EricJin101
Copy link
Author

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

@EricJin101
Copy link
Author

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

@DavidLSmyth
Copy link

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.

@EricJin101
Copy link
Author

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"

@DavidLSmyth
Copy link

DavidLSmyth commented Oct 19, 2018

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.

@EricJin101
Copy link
Author

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

@yuzw213
Copy link

yuzw213 commented Oct 24, 2018

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
Copy link

yuzw213 commented Oct 24, 2018

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

@EricJin101
Copy link
Author

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

@DavidLSmyth
Copy link

DavidLSmyth commented Oct 24, 2018

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

@yuzw213
Copy link

yuzw213 commented Oct 25, 2018

@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
Copy link

yuzw213 commented Oct 25, 2018

image
tim 20181025142432

@DavidLSmyth
Copy link

@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!

@RVBldr
Copy link
Contributor

RVBldr commented Nov 21, 2018

Internal VSTF 7413.

@AloshkaD
Copy link
Contributor

@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 ?

@DavidLSmyth
Copy link

@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 ?

I made some changes recently that may have broken some things, I'll have a look and get back to you when I've figured out what's gone wrong. If you don't need some of the latest functionality you could use one of the older commits (try 129596f)

@AloshkaD
Copy link
Contributor

Thanks @DavidLSmyth I look forward to that. Regarding the commit that you referenced, it does not seem related. It's an update to the simGetPositionWRTOrigin method.

@Hoshea7
Copy link

Hoshea7 commented Jul 28, 2019

Hi @AloshkaD ,

I still cannot figure out how to draw the line of the trajectory of multirotor, could you kindly explain more how you complete this ?

@tteague19
Copy link

@DavidLSmyth I am encountering an error that "rpclib: server could not find function 'simShowDebugLines' with argument count 0" when I try to use your fork. Strangely, the function is defined in your .hpp and .cpp files with the appropriate number of arguments. Would you be able to help with this issue? Thanks!

@DavidLSmyth
Copy link

I'll see if I can find the time to submit this as a clean pull request. Haven't done any maintenance on this fork for years...

@tteague19
Copy link

Thanks, @DavidLSmyth! In case you are unable to make the fix, do you know if there has been a similar capability developed within AirSim? Essentially, I want to indicate a connection between two or more multirotors for the purposes of visualization.

@DavidLSmyth
Copy link

Thanks, @DavidLSmyth! In case you are unable to make the fix, do you know if there has been a similar capability developed within AirSim? Essentially, I want to indicate a connection between two or more multirotors for the purposes of visualization.

I don't think so (you can turn on debug lines showing where the drone has flown, that's the closest thing I'm aware of) but you could put this together using a blueprint rather than making a change to the API (if you've seen images of other people doing this I'd guess they've just used a blueprint). I got pretty frustrated with blueprints in the end so I'd recommend to do this from the API if possible!

@DavidLSmyth
Copy link

Thanks, @DavidLSmyth! In case you are unable to make the fix, do you know if there has been a similar capability developed within AirSim? Essentially, I want to indicate a connection between two or more multirotors for the purposes of visualization.

Was just going through it there, maybe simPlotLineList is what you want? I wasn't aware this had been added!

@tteague19
Copy link

It is! By coincidence, I found that utility earlier this week, as well. Ideally, I would plot the lines throughout the simulation, but it suffices to use it between movements, which seems to be the only way to do so. If I become more proficient with AirSim, I will consider implementing something closer to what I have in mind. Thank you again for your help, @DavidLSmyth!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants