Fawkes とllsf-refbox との接続 その3

Fawkes とllsf-refbox との接続 その2の続き.
そろそろ,答えが見えてきました.

まずは,RefBox が動く環境と作ります.
RefBox と接続用の2台のPCを,用意します.

ネットワークは,192.168.4.0/24 です.

RefBox 側の~llsf-refbox/cfg/config.yaml は.以下の通り.

[wataru@liva-fedora ~]$ cat llsf-refbox/cfg/config.yaml 
%YAML 1.2
%TAG ! tag:fawkesrobotics.org,cfg/
---
# Configuration meta information document
include:
  # reads files ending in .yaml from conf.d config subdir
  # - !ignore-missing conf.d/
  # Reads the host-specific configuration file, no failure if missing
  - !host-specific host.yaml
---
# Main configuration document

llsfrb:
  log:
    level: info
    general: refbox.log
    clips: clips.log
    game: game.log

  sps:
    enable: false
    host: !ipv4 192.168.1.77
    port: !tcp-port 502
    test-lights: false

  mps:
    enable: false
    # type: 1(incoming station), 2(singel p&p), 3(double p&p), 4(delivery station)
    stations:
      C-BS:
        active: false
        type: BS
        host: !ipv4 192.168.2.27
        port: !tcp-port 502
      C-CS1:
        active: false
        host: !ipv4 192.168.2.24
        port: !tcp-port 502
        type: CS
      C-CS2:
        active: false
        host: !ipv4 192.168.2.25
        port: !tcp-port 502
        type: CS
      C-RS1:
        active: false
        host: !ipv4 192.168.2.23
        port: !tcp-port 502
        type: RS
      C-RS2:
        active: false 
        host: !ipv4 192.168.2.26
        port: !tcp-port 502
        type: RS
      C-DS:
        active: false
        host: !ipv4 192.168.2.28
        port: !tcp-port 502
        type: DS
      M-BS:
        active: false
        host: !ipv4 192.168.2.33
        port: !tcp-port 502
        type: BS
      M-CS1:
        active: false
        host: !ipv4 192.168.2.30
        port: !tcp-port 502
        type: CS
      M-CS2:
        active: false
        host: !ipv4 192.168.2.32
        port: !tcp-port 502
        type: CS  
      M-RS1:
        active: false
        host: !ipv4 192.168.2.31
        port: !tcp-port 502
        type: RS
      M-RS2:
        active: false
        host: !ipv4 192.168.2.34
        port: !tcp-port 502
        type: RS
      M-DS:
        active: false
        host: !ipv4 192.168.2.29
        port: !tcp-port 502
        type: DS

  clips:
    # Timer interval, in milliseconds
    timer-interval: 40

    main: refbox
    debug: true
    # debug levels: 0 ~ none, 1 ~ minimal, 2 ~ more, 3 ~ maximum
    debug-level: 2
    unwatch-facts: [time, signal, gamestate]
    unwatch-rules: [retract-time,
                    game-update-gametime-points, game-update-last-time,
                    net-send-beacon, net-send-GameState, net-send-OrderInfo,
                    net-send-MachineInfo, net-send-RobotInfo,
                    exploration-send-MachineReportInfo, net-broadcast-MachineInfo,
                    net-send-VersionInfo]

  comm:
    protobuf-dirs: ["@BASEDIR@/src/msgs"]

    server-port: !tcp-port 4444
    
    public-peer:
      host: !ipv4 192.168.4.255
      # host: !ipv4 127.0.0.1
      port: !udp-port 4444
      # send-port: !udp-port 4444
      # recv-port: !udp-port 4445

    cyan-peer:
      host: !ipv4 192.168.4.255
      # host: !ipv4 127.0.0.1
      port: !udp-port 4441
      # send-port: !udp-port 4441
      # recv-port: !udp-port 4446

    magenta-peer:
      host: !ipv4 192.168.4.255
      # host: !ipv4 127.0.0.1
      port: !udp-port 4442
      # send-port: !udp-port 4442
      # recv-port: !udp-port 4447

  mongodb:
    enable: false
    hostport: localhost
    collections:
      text-log: llsfrb.log
      clips-log: llsfrb.clipslog
      protobuf: llsfrb.protobuf

  game:
    teams: [Carologistics, BabyTigers]
    crypto-keys:
      Carologistics: randomkey
      BabyTigers: randomkey

  shell:
    refbox-host: localhost
    refbox-port: 4444

  simulation:
    enable: true
    # synchronize refbox time with the time of a simulation 
    time-sync:
      enable: true
      # estimate time by using the last given simulation time speed
      # (helps reducing the amount of messages to send)
      estimate-time: true

refbox 側にて gazebo を起動.
sendとrecvのport を使わないので,同一PC上で,複数のrefbox 通信関係のプログラムは動かせません.
つまり,robot のシミュレートは不可です.
というわけで,-n 0 で起動.

~/fawkes-robotino/bin/gazsim.bash -x start -a -r -n 0

~/fawkes-robotino/cfg/conf.d/clips-agent.yaml が怪しいので,
接続用PCにて,設定を変更した上で,plugin を順番に読み込んでみます.

    #real-world-setup:
    # peer-address: 172.26.255.255
    peer-address: 192.168.4.255
    peer-port: 4444
    cyan-port: 4441
    magenta-port: 4442

    team-name: Carologistics
    # team-name: BabyTigers
    crypto-key: randomkey
    cipher: "aes-128-cbc"

まず,roscore を起動.
別のタブで,plugin を読み込みます.
面倒なので,メタplugin を用意しました.

  m-wataru: static-transforms,webview,m-fv,ros,navgraph,navgraph-generator,navgraph-generator-mps,skiller,m-clips,clips-agent
  m-sim-wataru: static-transforms,webview,m-fv,ros,gazebo,gazsim-robotino,navgraph,navgraph-generator,navgraph-generator-mps,skiller,m-clips,clips-agent
cd ~/fawkes-robotino/bin
./fawkes -p m-wataru

これで,とりあえずビーコンを出してRefBox に現れ,
RefBox からの情報も,取得できるようになりました.

ふぅ.

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

*