Skip to content
This repository has been archived by the owner on Apr 9, 2018. It is now read-only.

Add VisionPublisher and Detection- and GeometrySupplier #29

Merged
merged 16 commits into from
Feb 13, 2018

Conversation

thumbnail
Copy link
Member

@thumbnail thumbnail commented Feb 12, 2018

todo

A proposed main could be as follows:

  public static void main(String[] args) throws UnknownHostException {
    Flux.combineLatest(
      new SSLVisionPublisher(InetAddress.getByName("localhost"), 123),
      new MulticastPublisher<>(InetAddress.getByName("localhost"), 1234, new UnsafeFunction<>(SSL_Referee::parseFrom)),
      InputFrame::new)
    .transform(new GameDeducer<>())
    .subscribe(System.out::println);
  }

  @Value
  public static class InputFrame implements GeometrySupplier, DetectionSupplier, SSLRefereeSupplier {
    @Delegate
    VisionFrame visionFrame;
    SSL_Referee SSLReferee;
  }

@thumbnail thumbnail requested a review from romni February 12, 2018 15:33
@thumbnail thumbnail self-assigned this Feb 12, 2018
@thumbnail thumbnail changed the base branch from fix-gamestate-deducers-split-goal-deducer to master February 12, 2018 15:47
@thumbnail thumbnail changed the title [WIP] Wrapperpacket supplier Wrapperpacket supplier Feb 12, 2018
public final class GamePublisher implements Publisher<GameFrame> {
private final Publisher<WrapperPacket> visionPublisher;
private final Publisher<SSL_Referee> refboxPublisher;
public final class GamePublisher<I extends WrapperPacketSupplier & SSLRefereeSupplier> implements Deducer<I, GameFrame> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be called GameDeducer?

return Flux.from(refboxPublisher)
.map(packet -> () -> new Referee.State(
.map(SSLRefereeSupplier::getSSLReferee)
.map(packet -> new Referee.State(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reverted

@thumbnail
Copy link
Member Author

Mobile doesn't allow for changing the title; e.g. this is still WIP, because

  • GamePublisher should be removed
  • RefereeDeducer should return a Referee.Supplier

.transform(new ParallelDeducer<>(
new SSLVisionDeducer<>(),
new SSLRefboxDeducer<>(),
GameFrameWithoutGoals::new))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on r51 you want to have

    <J extends Player.SetSupplier & GoalDimension.Supplier & Field.Supplier & Ball.SetSupplier>
    GameFrameWithoutGoals(final J packet, final Referee.Supplier referee) {

in order to get rid of the explicit dependency on VisionPacket

@thumbnail thumbnail changed the title Wrapperpacket supplier Add VisionPublisher and Detection- and GeometrySupplier Feb 13, 2018
@thumbnail thumbnail merged commit 4bf06fe into master Feb 13, 2018
@thumbnail thumbnail deleted the wrapperpacket-supplier branch February 13, 2018 12:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants