GRASP_PLUGINS="Grasp;PRM;GeometryHandler;ConstraintIK;SoftFingerStability;PCL;GraspDataGen;MotionFile"
GRASP_ROBOT_MODEL_PLUGINS='HIRO/Plugin'
Ubuntu 20.04とmasterブランチのChoreonoidとの組み合わせでビルド可
noetic | melodic | kinetic | indigo | |
---|---|---|---|---|
Choreonoid v1.7.0 | ※ | ✅ | ✅ | ✅ |
Choreonoid v1.6.0 | ※ | ✅ | ✅ | ✅ |
Choreonoid v1.5.0 | ※ | ✅ | ✅ | ✅ |
※ビルド可, rtshell非対応
- Clone this recursively
git clone https://github.com/kazuki0824/hlab-nxo-setup.git --depth 1 --recursive
- Enter externals/, and then run
sudo apt install curl -y &&./install_RTP.sh
- Install ROS1 by following this instruction
- Enter overlay_ws/, and run
ROS_DISTRO=<your_distro> ./setup_rtmros_ws.sh
source $HOME/.preinstalled/setup.bash
- Move the current directory to the location where hlab-nxo-setup is located. (i.e., out of 'hlab-nxo-setup')
- Install wget from apt.
sudo apt install wget
- Clone the graspPlugin repository in the same directory where hlab-nxo-setup is located. At this time, the name of the cloned directory should be 'grasp-plugin'.
- Run
hlab-nxo-setup/setup_choreonoid.sh <tag_name_of_cnoid>
. The tested <tag_name_of_cnoid> value sets are v1.7.0, v1.6.0, and v1.5.0.
After all the components above are installed, run the following. 1.
sudo apt install cmake-qt-gui gnome-terminal dbus-x11 -y
function connect_rtc() {
source `rospack find rtshell`/bash_completion
#rtcwd /localhost
host=/localhost:2809/${HOSTNAME}.host_cxt
rtcon $host/HiroNXGUI0.rtc:HiroNX $host/PortDuplicator0.rtc:HiroNX
rtcon $host/HiroNXGUI0.rtc:HIRO $host/PortDuplicator0.rtc:HIRO
rtcon $host/ArmController0.rtc:HiroNX $host/PortDuplicator0.rtc:HiroNX
rtcon $host/ArmController0.rtc:HIRO $host/PortDuplicator0.rtc:HIRO
rtcon $host/PortDuplicator0.rtc:HiroNX0 $host/HiroNXProvider0.rtc:HiroNX
rtcon $host/PortDuplicator0.rtc:HIRO0 $host/HiroNXProvider0.rtc:HIRO
rtcon $host/PortDuplicator0.rtc:HiroNX1 $host/HandManipProvider0.rtc:HiroNX
rtcon $host/PortDuplicator0.rtc:HIRO1 $host/HandManipProvider0.rtc:HIRO
rtact $host/HiroNXGUI0.rtc $host/HiroNXProvider0.rtc $host/ArmController0.rtc $host/PortDuplicator0.rtc $host/HandManipProvider0.rtc
}
This is the bash function to connect all the RT components automatically.
rtm-naming
gnome-terminal --window -e "bash -c \"sleep 3; ./hlab-nxo-setup/externals/eclipse/eclipse -debug -console; exec bash\"" \
--tab -e "bash -c \" ./build-choreonoid/bin/choreonoid; exec bash\"" \
--tab -e "bash -c \" ./choreonoid/ext/graspPlugin/RobotInterface/Nextage/THK/HandManipProvider.py; exec bash\"" \
--tab -e "bash -c \" ./choreonoid/ext/graspPlugin/RobotInterface/Nextage/PortDuplicator/PortDuplicator.py; exec bash\"" \
--tab -e "bash -c \" cd ./choreonoid/ext/graspPlugin/RobotInterface/Nextage/NextageInterface; ./HiroNXProvider.py;exec bash\"" \
--tab -e "bash -c \" ./hlab-nxo-setup/externals/hironx-interface/HiroNXInterface/HiroNXGUI/WxHiroNXGUI.py; exec bash\""
connect_rtc
- Run the following to establish the container
xhost +local:user && \
docker run --rm --pull always --gpus all -it -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix ghcr.io/kazuki0824/hlab-nxo-setup:melodic && \
xhost -local:user
git clone http://spica.ms.t.kanazawa-u.ac.jp/gitlab/tsuji/grasp-plugin.git --depth 1 -b fix_compatibility_2004_2204 && \
hlab-nxo-setup/setup_choreonoid.sh
function connect_rtc() {
source `rospack find rtshell`/bash_completion
#rtcwd /localhost
host=/localhost:2809/${HOSTNAME}.host_cxt
rtcon $host/HiroNXGUI0.rtc:HiroNX $host/PortDuplicator0.rtc:HiroNX
rtcon $host/HiroNXGUI0.rtc:HIRO $host/PortDuplicator0.rtc:HIRO
rtcon $host/ArmController0.rtc:HiroNX $host/PortDuplicator0.rtc:HiroNX
rtcon $host/ArmController0.rtc:HIRO $host/PortDuplicator0.rtc:HIRO
rtcon $host/PortDuplicator0.rtc:HiroNX0 $host/HiroNXProvider0.rtc:HiroNX
rtcon $host/PortDuplicator0.rtc:HIRO0 $host/HiroNXProvider0.rtc:HIRO
rtcon $host/PortDuplicator0.rtc:HiroNX1 $host/HandManipProvider0.rtc:HiroNX
rtcon $host/PortDuplicator0.rtc:HIRO1 $host/HandManipProvider0.rtc:HIRO
rtact $host/HiroNXGUI0.rtc $host/HiroNXProvider0.rtc $host/ArmController0.rtc $host/PortDuplicator0.rtc $host/HandManipProvider0.rtc
}
rtm-naming
gnome-terminal --window -e "bash -c \"sleep 3; ./hlab-nxo-setup/externals/eclipse/eclipse -debug -console; exec bash\"" \
--tab -e "bash -c \" ./build-choreonoid/bin/choreonoid; exec bash\"" \
--tab -e "bash -c \" ./choreonoid/ext/graspPlugin/RobotInterface/Nextage/THK/HandManipProvider.py; exec bash\"" \
--tab -e "bash -c \" ./choreonoid/ext/graspPlugin/RobotInterface/Nextage/PortDuplicator/PortDuplicator.py; exec bash\"" \
--tab -e "bash -c \" cd ./choreonoid/ext/graspPlugin/RobotInterface/Nextage/NextageInterface; ./HiroNXProvider.py;exec bash\"" \
--tab -e "bash -c \" ./hlab-nxo-setup/externals/hironx-interface/HiroNXInterface/HiroNXGUI/WxHiroNXGUI.py; exec bash\""
connect_rtc
cd hlab-nxo-setup
docker build . --build-arg DISTRIBUTION=<your_distro_name> -t grasp_img
xhost +local:user && \
docker run --name grasp --gpus all -it -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix grasp_img && \
xhost -local:user
- Inside a container, run
git clone http://spica.ms.t.kanazawa-u.ac.jp/gitlab/tsuji/grasp-plugin.git -b <branch>
and enter your credential. - Modify setup_choreonoid.sh.
hlab-nxo-setup/setup_choreonoid.sh
Lines 5 to 6 in de4e6b0
hlab-nxo-setup/setup_choreonoid.sh <tag>
- Exit the container.
To build Choreonoid manually, follow this.
docker start grasp && \
xhost +local:user && \
docker exec -it -e DISPLAY=unix$DISPLAY grasp /rtm_entrypoint.sh bash && \
xhost -local:user && \
docker stop grasp
And then run:
gnome-terminal --window -e "bash -c \"sleep 3; ./hlab-nxo-setup/externals/eclipse/eclipse -debug -console; exec bash\"" \
--tab -e "bash -c \" ./build-choreonoid/bin/choreonoid; exec bash\"" \
--tab -e "bash -c \" ./choreonoid/ext/graspPlugin/RobotInterface/Nextage/THK/HandManipProvider.py; exec bash\"" \
--tab -e "bash -c \" ./choreonoid/ext/graspPlugin/RobotInterface/Nextage/PortDuplicator/PortDuplicator.py; exec bash\"" \
--tab -e "bash -c \" cd ./choreonoid/ext/graspPlugin/RobotInterface/Nextage/NextageInterface; ./HiroNXProvider.py;exec bash\"" \
--tab -e "bash -c \" ./hlab-nxo-setup/externals/hironx-interface/HiroNXInterface/HiroNXGUI/WxHiroNXGUI.py; exec bash\""
connect_rtc
To test the operation of HiroNXProvider/HiroNXGUI on a simulation instead of connecting to the actual device, perform the following steps. This changes which machine the RobotInterface tries to connect to.
echo 'HiroNX(Robot)0' > ./choreonoid/ext/graspPlugin/RobotInterface/Nextage/NextageInterface/.robotname
echo localhost:15005 > ./choreonoid/ext/graspPlugin/RobotInterface/Nextage/NextageInterface/.robothost
After this, you can control the simulated robot in the hrpsys-simulator through HiroNXGUI and RobotInterface plugin.