magmaOffenburg / RoboViz

Monitor and visualization tool for the RoboCup 3D Soccer Simulation League
Apache License 2.0
50 stars 17 forks source link

Adding feature of different color jersey for goalies. #102

Closed pmacalpine closed 6 years ago

pmacalpine commented 6 years ago

This loads in a new body model object for goalies (jersey number 1) where the primary color of the torso is set to naogoalie. Currently naogoalie is a bright orange color, but it could probably be changed to be configurable in the same way that team colors are configurable. This is an experimental enhancement and potentially closes issue #101.

Gama11 commented 6 years ago

I guess this looks okay for the red team, although it might look better if those white "shoulder parts" were colored as well?

I don't think the orange really works for the blue team, maybe it should be a light blue. "A lighter version of whatever the primary color is" might work for this in general, that way it would work automatically with custom team colors?

pmacalpine commented 6 years ago

I modified things to make the jersey color be a lighter version of the team color (or darker if the goalie jersey color would be super bright or very close to white). Variables that control how the goalie jersey color is chosen are in ContentManager.java. Goalie jersey color is specified in models with matTeamGoalie, and then is replaced with mat<Left|Right>Goalie in the same way that matTeam is replaced.

Gama11 commented 6 years ago

Nice, I think that looks a lot better than before! 👍 However, I've noticed a strange bug where the jersey color briefly flashes between white and blue every so often:

(actually took me several tries to record a .gif that shows the problem, maybe because of the framerate difference)

This happens fairly frequently for me when viewing a logfile. I haven't tried during regular "server mode", but I expect it would happen there as well. Can you reproduce this?

Gama11 commented 6 years ago

Oh, and on the back of the goalie, there's still a white patch leftover around the player number, which looks a bit odd. Could that be tinted appropriately as well?

pmacalpine commented 6 years ago

I changed it so that the color around the number matches the goalie's jersey color. This could be a little problematic if the goalie's jersey color is really dark making the number hard to read, but with the default colors I think it looks good. It might be possible to make the color white if the jersey color is really dark, but I haven't found an easy way to do that yet.

pmacalpine commented 6 years ago

The flickering was caused by the regular nao model being switched out with the goalie jersey model whenever the scene graph is updated. To initiate this flickering you can continuously press the "U" key to get a full scene update causing the scene graph to be updated. I changed it so that the regular nao model is only replaced by the goalie jersey model when a new Agent is created -- this is more efficient and seems to have fixed the flickering issue.

Gama11 commented 6 years ago

Looks good now - and just in time for RoboCup. :) Thanks!