cobottaのrosのメモ(Melodicの失敗例)のメモ

cobottaのrosのメモ(Kineticの例…) のメモでUbuntu 16.04からCobottaに接続できたので,cobottaのrosのメモ(Melodicの失敗例)のリベンジ.

sudo apt-get update; sudo apt-get upgrade; sudo apt-get dist-upgrade;
sudo apt-get remove libreoffice-common
sudo apt-get autoremove

sudo apt-get install git vim tigervnc-viewer net-tools
sudo update-alternatives --config editor

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://ha.pool.sks-keyservers.net:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update

sudo apt-get install ros-melodic-desktop-full
sudo apt-get install python-rosdep python-genmsg libyaml-cpp-dev # ← python-rosdep python-genmsg libyaml-cpp-dev # python-rosdep2 を入れると,ros-melodic の大半のパッケージが削除されましたので,python-rosdep に修正.この前のマシンは,rosdep2 でいたけんだけどなぁ.
sudo apt-get install ros-melodic-actionlib ros-melodic-controller-manager ros-melodic-joint-limits-interface ros-melodic-transmission-interface ros-melodic-realtime-tools ros-melodic-moveit-commander ros-melodic-moveit ros-melodic-robot-state-publisher
sudo rosdep init
rosdep update
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc

git clone https://github.com/DENSORobot/denso_robot_ros/
git clone https://github.com/DENSORobot/denso_cobotta_ros/

#
# denso_robot_ros/denso_robot_control/launch/denso_robot_control.launch
# 上記のファイルの中身をcobotta用に変更.具体的には,ip_addressと,robot_name です.

cd denso_robot_ros
for DIR in bcap_core bcap_service denso_robot_core denso_robot_control denso_robot_descriptions; do
    pushd $DIR
    cmake .
    make
    sudo make install
    source /usr/local/setup.bash
    popd
done
 
cd ../denso_cobotta_ros
for DIR in denso_cobotta_lib denso_cobotta_descriptions; do
    pushd $DIR
    cmake .
    make
    sudo make install
    source /usr/local/setup.bash
    popd
done

sudo ln -s ~/denso_cobotta_ros/denso_cobotta_descriptions/cobotta_description /usr/local/share/denso_cobotta_descriptions/
sudo ln -s ~/denso_cobotta_ros/denso_cobotta_lib/devel/lib/libdenso_cobotta_lib.so /opt/ros/melodic/lib/
sudo ln -s ~/denso_cobotta_ros/denso_cobotta_lib/include/denso_cobotta_lib /usr/include/

for DIR in denso_cobotta_driver denso_cobotta_gripper denso_cobotta_control; do
    pushd $DIR
    cmake .
    make
    sudo make install
    source /usr/local/setup.bash
    popd
done

sudo apt-get install python-pip
pip install --upgrade pip
pip install --user pyassimp

sudo cp -r ~/denso_cobotta_ros/denso_cobotta_descriptions/cobotta_description /usr/local/share/denso_robot_descriptions
sudo cp /usr/local/share/denso_robot_descriptions/vs060_description/vs060.launch.xml /usr/local/share/denso_robot_descriptions/cobotta_description/cobotta.launch.xml
sudo ln -s /usr/local/share/denso_robot_descriptions/cobotta_description/denso_cobotta_control.yaml /usr/local/share/denso_robot_descriptions/cobotta_description/denso_robot_control.yaml 
#
# cobotta_description/cobotta.urdf.xacro を cobotta.urdf に展開する必要があります.
# xacro がうまく動作しなかったので,cobotta 上で展開してからコピーしました.
# cobotta の denso_cobotta_ros/denso_cobotta_descriptions/cobotta_description/cootta.urdf に対して
# rosrun xacro xacro cobotta.urdf.xacro --inorder > cobotta.urdf
# で作成できます

export ROS_HOSTNAME="ubuntu" # ← PCの名前
export ROS_IP="10.42.0.88" # ← PCのIPアドレス
export ROS_MASTER_URI="http://10.42.0.184:11311/" # ← cobotta のroscore

roslaunch denso_robot_control denso_robot_control.launch

あれ,なんかpublisher あたりの調子が悪い?
→ hostname の調整を間違えていました.複数のマシンで同じhostname を使っていると,cobotta 側が通信できなくなり「unable to connect to move_group action server」のエラーを出します.
→ それぞれの/etc/hosts にマシン名とIPアドレスを書いた方が無難っぽいです.

コメントを残す

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

*