RobotinoでRCLLに出る方法.

RefBox との通信が鍵になってきます.
RefBox <=> ROS <=> View という二段階の通信が必要となり,そのための手順をまとめます.

RefBox やROS 関係のパッケージのインストール等は終わっていることとします.

まずは,関係するソースをとってきます.

#
# get RefBox Code
#
cd
git clone https://github.com/robocup-logistics/rcll-refbox
cd rcll-refbox
git checkout neltester/challenges-2021
git pull --ff-only
make

BTR2021の準備(Ubuntu 18.04)のメモにありますが,エラーが出るので ~/rcll-refbox/etc/buildsys/config.mk の最後(「endif # __buildsys_config_mk_」の手前)に以下を追加.

CFLAGS_EXTRA += -Wno-unused-variable

とりあえず,これで再度makeしましょう.

#
# get ROS code
#
mkdir -p ~/catkin_ws/src
# cd ~/catkin_ws
# git clone https://github.com/timn/ros-rcll_ros_msgs
# git clone https://github.com/timn/ros-rcll_refbox_peer
cd
git clone https://github.com/wadaru/BabyTigers
ln -s ~/BabyTigers/ros/ros* catkin_ws/src/
mkdir -p ~/catkin_ws/src/ros-rcll_btr_msgs/msg
#
# set for RefBox
#
ln -s ~/rcll-refbox/src/msgs ~/rcll-refbox/src/libs/llsf_msgs
#
cd catkin_ws
catkin_make
cd ..

さて,起動してみましょうか.
RefBox は,別のマシンで動いているものとします.
ターミナルのタブがいくつか必要です.
上記のcatkin_make が反映されていない場合は,source ~/catkin_ws/devel/setup.bash の実行を忘れないように.

# 1つ目
roscore
# 2つ目
source ~/catkin_ws/devel/setup.bash
IP=172.26.255.255
pushd ~/catkin_ws/src/ros-rcll_refbox_peer/launch
roslaunch rcll_refbox_peer.launch num_robots:=1 team_name:=BabyTigers robot_name:=kotora robot_number:=1 crypto_key:=randomkey peer_address:=$IP peer_public_send_port:=4444 peer_public_recv_port:=4444 peer_cyan_send_port:=4441 peer_cyan_recv_port:=4441 peer_magenta_send_port:=4442 peer_magenta_recv_port:=4442
popd
# 3つ目
# ↓ 今は「~」が使える模様
robview ~/BabyTigers/ros/ros-rcll_btr_msgs/refbox-view3.rvw2 
# 4つ目
rosrun rcll_btr_msgs refbox-view3.py

あれ,rcll_btr_msgs が登録されていませんね….
ちと 調査します.

ROSでビルドしたパッケージが認識されなかったときの対処法に書いてありました.

cd ~/catkin_ws
catkin_make
rospack profile
source ~/catkin_ws/devel/setup.bash

これで,rosrun rcll_btr_msgs refbox-view3.py が動きます.

 source ~/catkin_ws/devel/setup.bash

で対応できる可能性が高いです.
refbox-frontend から操作すれば,競技の流れが理解できるはずです.

コメントを残す

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

*