bhuman / BHumanCodeRelease

The official B-Human code releases
Other
188 stars 126 forks source link

Plotting #67

Closed Saman-Khan closed 1 year ago

Saman-Khan commented 1 year ago

Hi, while vp command can be used to plot 1D variables, data on your axis and time on x axis. How can we plot 2D data. Variable A on x axis and variable B on y axis. Any help would be appreciated

roefer commented 1 year ago

You cannot out of the box. You have to program this yourself.

ahasselbring commented 1 year ago

In most cases, drawing on a field view or image view is the real solution.

Saman-Khan commented 1 year ago

Thanks @ahasselbring that seems a good idea. If u can just highlight the code to be looked for adding code to plot as 2D. As u have extensive knowledge of code , a proper direction from u saves a lot of time. U once suggested how to add force to objects on simulator and the help worked really well. So, if u have any hints on where to look for, it will be great. Also, I understand that u must be busy, so it's fine if u don't discuss. Also, it's a request to please keep issue open for a few days so that someone else can reply. @ahasselbring I am really glad that u gave me right direction of plotting in field view. I will always be indebted for your time and support 😇

Saman-Khan commented 1 year ago

Also, the image using update method returns only current position of object. Let's say, the ball, but the need is to retain all previous values, previous positions on field view , any hints on doing that @ahasselbring . Apologies in advance to disturb u

ahasselbring commented 1 year ago

https://wiki.b-human.de/coderelease2022/architecture/#debug-drawings https://wiki.b-human.de/coderelease2022/simrobot/#image-views https://wiki.b-human.de/coderelease2022/simrobot/#field-views https://wiki.b-human.de/coderelease2022/simrobot/#robot-commands

Example: https://github.com/bhuman/BHumanCodeRelease/blob/coderelease2022/Src/Representations/Modeling/BallModel.cpp#L60

You can keep a buffer of the previous objects and draw them in a loop with the same drawing ID (if I am understanding correctly what you want to do).

Saman-Khan commented 1 year ago

Thanks @ahasselbring the buffer idea worked well. I was wondering how the cards for opponents are set. I am talking about Code Release 2021. I want to know, is there a way, in which, i can assign a specific card to , lets say player 9, of opponent team. I badly need some words of wisdom on this. This will be my last question i promise. I hope u reply