UBC-Thunderbots / Software

Robot Soccer Playing AI
http://www.ubcthunderbots.ca
GNU Lesser General Public License v3.0
47 stars 98 forks source link

Gamecontroller can Bind to a Different Port Based on Command Line Argument #3207

Open Mr-Anyone opened 1 month ago

Mr-Anyone commented 1 month ago

Description

Game controller can now bind on a different port

Testing Done

Ran the following commands:

./tbots.py test kickoff_play_test --gamecontroller_port 50000 --enable_thunderscope
./tbots.py run thunderscope --gamecontroller_port 50001 

and when each of the command from above is running, I ran

ps aux | grep gamecontroller

Resolved Issues

resolves #3160

Length Justification and Key Files to Review

N/A

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

itsarune commented 1 month ago

@nimazareian covered everything, I don't have anything more to add onto nima's conversation

Mr-Anyone commented 3 weeks ago

Test New Changes

I am not sure if I quite understand. You want something like the following?

./tbots.py run thunderscope  --use_unconventional_port --not_launch_gc
./tbots.py test pivot_kick_field_test --keyboard_estop --use_unconventional_port 

Currently, there is a bug in the toolbar. Before I fix that, I want to make sure I have correctly implemented the requested change.

nimazareian commented 3 weeks ago

Test New Changes

I am not sure if I quite understand. You want something like the following?

./tbots.py run thunderscope  --use_unconventional_port --not_launch_gc
./tbots.py test pivot_kick_field_test --keyboard_estop --use_unconventional_port 

Currently, there is a bug in the toolbar. Before I fix that, I want to make sure I have correctly implemented the requested change.

@itsarune can pitch in as well, but I think we should always used an "unconventional port" for the GC, unless we're running --run_blue/--run_yellow without --launch_gc (i.e. in every scenario we should use an unconventional port, unless we're in an actual real life game, hence the --run_blue/--run_yellow without the --launch_gc since we're just using the GC that is used on the field by both teams. So there shouldn't be a need for the arg --use_unconventional_port and only --launch_gc should be added. This new arg could be optionally paired with --run_blue/--run_yellow to run our own game controller (both in Thunderscope and in the field test fixture).

For your reference, right now when we play actual games, I often run Thunderscope with something like: ./tbots.py run thunderscope --interface wlp2s0 --run_blue In the updated logic, running that command should NOT launch the game controller, and should listen on the official GC port.

Mr-Anyone commented 1 week ago

I think I may have implemented the requested feature.

I've tested this with the following two commands:

./tbots.py run thunderscope --run_blue --interface wlp0s20f3 --keyboard_estop --launch_gc
./tbots.py run thunderscope --run_blue --interface wlp0s20f3 --keyboard_estop 
Mr-Anyone commented 5 days ago

I've just ran fix_formatting.sh. It seems that my system is missing an dynamic library libtinfo-dev. This is solved through apt-get.