Formula-Student-Driverless-Simulator icon indicating copy to clipboard operation
Formula-Student-Driverless-Simulator copied to clipboard

Drawing debug graphics

Open KnockerPulsar opened this issue 4 years ago • 3 comments

Hello, it's me again. This time, I'm trying to do some debug graphics.

  • Background: I already have some experience with UE4, I know a bit of ROS. No AirSim experience though.
  • What I'm trying to accomplish: Send some points to UE4 to render them in lines. I tried looking through the docs but nothing crops up.

Any idea how to do this? I can try extending client.py, but I think there's more to do inside the AirSim plugin to receive the data and command the engine to render it. Any and all pointers are appreciated.

KnockerPulsar avatar Nov 10 '21 23:11 KnockerPulsar

Hi @KnockerPulsar,

I'm not exactly sure what you mean, but Airsim basically runs a server to which you send commands. I myself do not have a lot of experience but you could try to take a look at how the cones are transmitted inside the Referee blueprint. This referee then gets accessed from the ros package (by calling CarApiBase::RefereeState).

Hope this helps!

wouter-heerwegh avatar Nov 10 '21 23:11 wouter-heerwegh

Thanks for the quick reply. I have attached an image of what I'm trying to achieve: Screenshot from 2021-11-11 01-38-34

I'm hoping to do something similar to the lidar's debug lines but with my own lines sent from python code (if possible) The plan is:

  • Get lidar readings and convert them to cones. Something similar to this is done in autonomous_example.py.
  • Do some path planning algorithms on the cones, the output should be a set of points that construct a path.
  • Send those points to AirSim/UE4 and draw them in the world, similar to how the lidar's lines are drawn.

The 2 big question marks for me are how to send data from python and receive it in UE4, and then how to command UE4 to draw them,

I tried doing a quick google on debug drawing in AirSim, but nothing useful came up.

KnockerPulsar avatar Nov 11 '21 00:11 KnockerPulsar

You could try to do it this way, however, I think you are going to spend a lot more time than trying to plot everything in rviz.

Take a look at this. You could export meshes from the sim and draw them with the markers.

Here is an example from this repo 687474703a2f2f696d672e796f75747562652e636f6d2f76692f4e586154774337443468492f302e6a7067.jpeg

There are 2 topics with the exact data from the sim (marked with testing_only). If you use those, do not use the binary because there are still some bugs with the testing_only topics in there.

wouter-heerwegh avatar Nov 11 '21 08:11 wouter-heerwegh

We're not currently planning on extending the support for debug drawing inside of the simulator. I'd recommend the same thing as Wouter, namely to perform all visualizations in RVIZ

mateusz-lichota avatar Sep 03 '22 21:09 mateusz-lichota