Skip to content

Commit

Permalink
Merge pull request #1302 from k-okada/add_cobotta
Browse files Browse the repository at this point in the history
add initial jsk cobotta packages
  • Loading branch information
k-okada authored Sep 22, 2021
2 parents d8d655c + 49f3e70 commit 0e361c1
Show file tree
Hide file tree
Showing 28 changed files with 772 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kinetic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ jobs:
NOT_TEST_INSTALL : true
ROS_DISTRO : kinetic
USE_DEB : false
BEFORE_SCRIPT : "wstool merge jsk_robot/jsk_fetch_robot/jsk_fetch_user.rosinstall.kinetic; wstool update; apt-get download ros-kinetic-julius; wget -O stripdeb.sh https://gist.githubusercontent.com/jordansissel/748313/raw/8aebce360bc082e33af7bba3c90f755eb655783b/stripdeb.sh; bash stripdeb.sh ros-kinetic-julius*.deb; sudo dpkg --force-all -i ros-kinetic-julius*.deb; sudo apt-get -y -f install; sudo apt-mark hold ros-kinetic-julius"
BEFORE_SCRIPT : "wstool merge jsk_robot/jsk_fetch_robot/jsk_fetch_user.rosinstall.kinetic; wstool update; apt-get download ros-kinetic-julius; wget -O stripdeb.sh https://gist.githubusercontent.com/jordansissel/748313/raw/8aebce360bc082e33af7bba3c90f755eb655783b/stripdeb.sh; bash stripdeb.sh ros-kinetic-julius*.deb; sudo dpkg --force-all -i ros-kinetic-julius*.deb; sudo apt-get -y -f install; sudo apt-mark hold ros-kinetic-julius; git clone https://github.com/k-okada/denso_robot_ros.git; (cd ..; git clone https://github.com/k-okada/cobotta_descriptions.git); (cd denso_robot_ros/denso_robot_descriptions; cp -r ../../../cobotta_descriptions/cobotta_description . )"
EXTRA_DEB : "ros-kinetic-convex-decomposition ros-kinetic-ivcon"
2 changes: 1 addition & 1 deletion .github/workflows/melodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
NOT_TEST_INSTALL : true
ROS_DISTRO : melodic
USE_DEB : false
BEFORE_SCRIPT : "apt-get download ros-melodic-julius; wget -O stripdeb.sh https://gist.githubusercontent.com/jordansissel/748313/raw/8aebce360bc082e33af7bba3c90f755eb655783b/stripdeb.sh; bash stripdeb.sh ros-melodic-julius*.deb; sudo dpkg --force-all -i ros-melodic-julius*.deb; sudo apt-get -y -f install; sudo apt-mark hold ros-melodic-julius"
BEFORE_SCRIPT : "apt-get download ros-melodic-julius; wget -O stripdeb.sh https://gist.githubusercontent.com/jordansissel/748313/raw/8aebce360bc082e33af7bba3c90f755eb655783b/stripdeb.sh; bash stripdeb.sh ros-melodic-julius*.deb; sudo dpkg --force-all -i ros-melodic-julius*.deb; sudo apt-get -y -f install; sudo apt-mark hold ros-melodic-julius; git clone https://github.com/k-okada/denso_robot_ros.git; (cd ..; git clone https://github.com/k-okada/cobotta_descriptions.git); (cd denso_robot_ros/denso_robot_descriptions; cp -r ../../../cobotta_descriptions/cobotta_description . )"
2 changes: 1 addition & 1 deletion .github/workflows/noetic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
ROS_DISTRO : noetic
USE_DEB : false
TEST_PKGS : "jsk_robot_startup" # check only jsk_robot_startup
BEFORE_SCRIPT : "apt-get download ros-noetic-julius; wget -O stripdeb.sh https://gist.githubusercontent.com/jordansissel/748313/raw/8aebce360bc082e33af7bba3c90f755eb655783b/stripdeb.sh; bash stripdeb.sh ros-noetic-julius*.deb; sudo dpkg --force-all -i ros-noetic-julius*.deb; sudo apt-get -y -f install; sudo apt-mark hold ros-noetic-julius"
BEFORE_SCRIPT : "apt-get download ros-noetic-julius; wget -O stripdeb.sh https://gist.githubusercontent.com/jordansissel/748313/raw/8aebce360bc082e33af7bba3c90f755eb655783b/stripdeb.sh; bash stripdeb.sh ros-noetic-julius*.deb; sudo dpkg --force-all -i ros-noetic-julius*.deb; sudo apt-get -y -f install; sudo apt-mark hold ros-noetic-julius; git clone https://github.com/k-okada/denso_robot_ros.git; (cd ..; git clone https://github.com/k-okada/cobotta_descriptions.git); (cd denso_robot_ros/denso_robot_descriptions; cp -r ../../../cobotta_descriptions/cobotta_description . )"
168 changes: 168 additions & 0 deletions jsk_denso_robot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# jsk_denso_robot


ROS package for Denso b-CAP communication robot.


## How to setup development environment

use `wstool`, `rosdep` and `catkin` to checkout and compile the source tree.

```
mkdir -p ~/denso_ws/src
cd ~/denso_ws/src
wstool init
wstool merge https://raw.githubusercontent.com/k-okada/jsk_robot/add_cobotta/jsk_denso_robot/denso.rosinstall
wstool update
cd ../
git clone https://github.com/k-okada/cobotta_descriptions.git
(cd src/denso_robot_ros/denso_robot_descriptions; ln -sf ../../../cobotta_descriptions/cobotta_description .)
source /opt/ros/melodic/setup.bash
rosdep install -y -r --from-paths src --ignore-src
catkin build cobottaeus jsk_cobotta_startup -vi
source devel/setup.bash
```

## COBOTTA Setup

Please refer to [COBOTTA User Manuals](https://www.fa-manuals.denso-wave.com/jp/COBOTTA/007030/) to setup your robot.
To install Virtual TP software, please refer to [Software Install](https://www.fa-manuals.denso-wave.com/jp/COBOTTA/007263/) section of the User Manuals.

## Start Virtual IP

To control the robot, you need to start Virtual TP software and push top-left 'Connect' menu.


![](img/vtp-init.png)

Then you need to input the IP address of your robot. The default robot IP address is '192.169.0.1'.

![](img/vtp-connect.png)

To control the robot, you need to specify user level and password. The default password can be find [COBOTTA User Manuals](https://www.fa-manuals.denso-wave.com/jp/COBOTTA/007030/)

![](img/vtp-login.png)

You can skip calibration section and also put "Prepare Motion"

![](img/vtp-skip.png)

This is main user interface. You can push 'cancel' button on right-top to back to this panel.

![](img/vtp-display.png)

### Setup IP address of the robot

You may want to change IP address of the robot, to connect your network. To do this, please push "Setting" button on the right bottom.

![](img/vtp-exec1.png)

Then push 'Network and communication (F2)'.

![](img/vtp-network1.png)

Now, you can change IP address.

![](img/vtp-network2.png)

You can set the IP address by using this 10-key like interface. You need to push 'OK' button of 10-key like panel, and then push 'OK' button of 'Communication Setting' panel.

![](img/vtp-network3.png)

### Setup IP address of client computer

To work with ROS node. You need to tell IP address of your ROS node running computer to the robot.
This is called 'executable' and you need to set 'executable' IP address from Virtual TP software.

Form main panel, push "Setting" button on the right bottom.

![](img/vtp-exec2.png)

Then push 'Executable (F1)'

![](img/vtp-exec3.png)

Select 'Ethernet' tab and change IP address.

![](img/vtp-exec4.png)

You can set the IP address by using this 10-key like interface. You need to push 'OK' button of 10-key like panel, and then push 'OK' button of 'Communication Setting' panel.

## Start ROS Node

```
source ~/denso_ws/devel/setup.bash
roslaunch --screen jsk_cobotta_startup cobotta_bringup.launch ip_address:=192.168.0.1
```

Make sure that `ip_address` is set by [Setup IP address of the robot](#setup-ip-address-of-the-robot) and your ROS client node IP address is set by [Setup IP address of client computer](#setup-ip-address-of-client-computer).

## Use EusLisp model

To control the robot form EusLisp. Please start `roseus` and type as follows.

```
(load "package://cobottaeus/cobotta-interface.l")
(cobotta-init)
```

Use `:angle-vector` method to specify the arm joint angle.
```
(send *cobotta* :angle-vector #f(0 20 80 0 20 0.0))
```


You can also use `:inverse-kinematics` method to specify the arm pose from target coordinates.
```
(send *cobotta* :arm :inverse-kinematics (make-coords :pos #f(150 0 50) :rpy (float-vector pi 0 pi)) :debug-view t)
```

To move the gripper 50 [mm] up, you can use `move-end-pos` method.
```
(send *cobotta* :arm :move-end-pos #f(0 0 -50))
```

You can also use `move-end-rot` method to turn the gripper.
```
(send *cobotta* :arm :move-end-rot -90 :z)
```


To control real robot. you can use `*ri*` object.
```
(send *ri* :angle-vector (send *cobotta* :angle-vector) 2000)
```
`2000` indicates we ask robot to move for `2000 [msec]`

To obtain current robot pose, use `:state :potentio-vector` method.
```
(send *ri* :state :potentio-vector)
```

To open and close the gripper. You can use `:start-grasp` and `:stop-grasp`.
```
(send *ri* :stop-grasp)
(send *ri* :start-grasp)
```

`:start-grasp` method returns `t` if it succeeded to grasp object. If it returns `nil`, nothing was grasped.

When the robot detect errors, the LED of the robot become yellow or red. Or you can find warning message like follows.
```
[ WARN] [1607683352.232275227]: Call {func_id: 72, vntArgs: ({vt: 3, value: 182} {vt: 3, value: 1} {vt: 8, value: P(210.0,0.0,-60.0,180.0,0.0,80.0,261)} {vt: 8, value: })}
-2111814862 -7ddfbcce
[ WARN] [1607683352.232440142]: ** ERROR_CODE 82204332 (Unknown error message) **
```
In this situation, you can clear error by
```
(send *ri* :clear-error)
```

If error still occurs, try `:dispose` and `:init` again.
```
(send *ri* :dispose)
(send *ri* :init)
```

---
If you have any question, please feel free to file open at https://github.com/jsk-ros-pkg/jsk_robot/issues
55 changes: 55 additions & 0 deletions jsk_denso_robot/cobottaeus/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
cmake_minimum_required(VERSION 2.8.3)
project(cobottaeus)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roseus
euscollada
)
find_package(denso_cobotta_descriptions) # Just in case when description is not released. Avoid compile failing

catkin_package()

if(NOT denso_cobotta_descriptions_FOUND)
message(WARNING "denso_cobotta_descriptions is not found, so skip generating cobotta.l")
message(WARNING "Install denso_cobotta_descriptions from https://github.com/DENSORobot/denso_cobotta_ros")
return()
endif()


###########
## Build ##
###########
if(EXISTS ${denso_cobotta_descriptions_SOURCE_PREFIX}/cobotta_description)
set(_cobotta_urdf ${denso_cobotta_descriptions_SOURCE_PREFIX}/cobotta_description)
else()
set(_cobotta_urdf ${denso_cobotta_descriptions_PREFIX}/share/denso_cobotta_descriptions/cobotta_description)
endif()
set(_collada2eus ${euscollada_PREFIX}/lib/euscollada/collada2eus)


message("cobotta_urdf: ${_cobotta_urdf}")
message("collada2eus: ${_collada2eus}")

add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/cobotta.urdf
COMMAND xacro ${_cobotta_urdf}/cobotta.urdf.xacro > ${PROJECT_BINARY_DIR}/cobotta.urdf
DEPENDS ${_cobotta_urdf}/cobotta.urdf.xacro)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/cobotta.l
COMMAND echo "${_collada2eus} ${PROJECT_BINARY_DIR}/cobotta.urdf cobotta.l"
COMMAND ${_collada2eus} ${PROJECT_BINARY_DIR}/cobotta.urdf ${PROJECT_SOURCE_DIR}/cobotta.yaml ${PROJECT_SOURCE_DIR}/cobotta.l
DEPENDS ${PROJECT_BINARY_DIR}/cobotta.urdf ${PROJECT_SOURCE_DIR}/cobotta.yaml ${_collada2eus})
add_custom_target(compile_cobotta ALL DEPENDS ${PROJECT_SOURCE_DIR}/cobotta.l)


install(DIRECTORY euslisp test
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS)

install(FILES cobotta.l cobotta-interface.l cobotta-util.l cobotta.yaml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

if(CATKIN_ENABLE_TESTING)
find_package(catkin REQUIRED COMPONENTS rostest)
add_rostest(test/test-cobotta.test)
endif()
Loading

0 comments on commit 0e361c1

Please sign in to comment.