Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial jsk_kinova_robot package #1313

Merged
merged 46 commits into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c7cf7b2
Add kinovaeus
708yamaguchi Jan 2, 2021
4d384db
Add test depend
708yamaguchi Jan 3, 2021
22ac6cc
Grasp method in Kinematic Simulator and IRT Viewer
708yamaguchi Jan 3, 2021
f7f7697
Enable to use MoveIt!
708yamaguchi Jan 3, 2021
cb7aae9
Test with Gazebo
708yamaguchi Jan 3, 2021
bebbc72
Update .rosinstall
708yamaguchi Jan 3, 2021
bd846c8
add jsk_kinova_startup
k-okada Jan 4, 2021
1fcecbe
add ros_kortex_vision to .rosinstall
k-okada Jan 4, 2021
b1fd2bb
update CMakeLists.txt use foreach to compile robots
k-okada Jan 4, 2021
187ad36
update README
k-okada Jan 4, 2021
8bb4170
update .gitignore
k-okada Jan 4, 2021
826c64a
add robotiq_2f_140 to test_depend
k-okada Jan 4, 2021
2a88c96
use collar for 1st joint, use tool\frame for end-coords
k-okada Jan 4, 2021
97e9ccd
rename gen3-interface to kinova-interface/kinova-utils, and add kinova.l
k-okada Jan 4, 2021
840ba1c
add test codes for eusmodel
k-okada Jan 4, 2021
907b767
Merge pull request #4 from k-okada/add_kinova
708yamaguchi Jan 4, 2021
a74b702
fix bugs
708yamaguchi Jan 4, 2021
f80148c
Add grasp methods document
708yamaguchi Jan 4, 2021
8b15746
Fix grasp functions
708yamaguchi Jan 4, 2021
a569e75
Fix tests
708yamaguchi Jan 4, 2021
567db83
Fix for travis test
708yamaguchi Jan 5, 2021
e67bece
Re-define minjerk-interpolator
708yamaguchi Jan 6, 2021
5962e93
Use real kinova gen3 lite robot
708yamaguchi Jan 14, 2021
7b6d5cb
move functions to robot-interface.l
708yamaguchi Jan 23, 2021
1bdf8da
Use :minjerk-interpolation by default in :angle-vector
708yamaguchi Jan 25, 2021
9868f91
Use different instance between (*ri* . robot) and *kinova*
708yamaguchi Jan 26, 2021
c8805ee
Currently angle-vector-sequence with minjerk interpolation and MoveIt…
708yamaguchi Jan 26, 2021
aadafe8
Add url for :angle-vector-sequence
708yamaguchi Jan 26, 2021
c40d237
re-define robot-interface methods
708yamaguchi Jan 29, 2021
d94b382
Avoid minjerk's large velocity and acceleration
708yamaguchi Feb 2, 2021
d3e716d
Add kinova-interface methods to use kinova arm's original function
708yamaguchi Feb 2, 2021
d19a6ce
add network setting information to README
tkmtnt7000 Jun 9, 2021
7023c93
*gen3* -> *ri* in README
tkmtnt7000 Jun 9, 2021
4728794
add Trouble shooting in README
tkmtnt7000 Jun 9, 2021
86ada1a
fix typo in kinova README
tkmtnt7000 Jun 9, 2021
b5036ca
add joint position limits to README
tkmtnt7000 Jun 9, 2021
b38d5ca
add links to URDF depcriptions to README
tkmtnt7000 Jun 10, 2021
4adadb8
fix typo in README
tkmtnt7000 Jun 10, 2021
0d611dd
add a new error
tkmtnt7000 Jun 10, 2021
6a66d6f
add displaying error msg at kinova-interface.l
tkmtnt7000 Jun 10, 2021
6fbc1cd
Merge branch 'tsukamoto/kinova-gen3' of https://github.com/tkmtnt7000…
tkmtnt7000 Jun 10, 2021
670ebb5
display error code in action-result-cb
tkmtnt7000 Jun 11, 2021
e48a5cc
Merge pull request #5 from tkmtnt7000/tsukamoto/kinova-gen3
708yamaguchi Jun 11, 2021
93f19b1
Give up waiting for upstream and remove TODOs for PR merge
708yamaguchi Jun 16, 2021
4421065
Merge branch 'master' into kinova-gen3
708yamaguchi Jun 16, 2021
bac895a
Merge branch 'master' into kinova-gen3
k-okada Jul 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 211 additions & 0 deletions jsk_kinova_robot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# jsk_kinova_robot

ROS package for KINOVA Gen3/Gen3 Lite robot.

- KINOVA web page
https://www.kinovarobotics.com/en/products/gen3-robot
- GitHub
https://github.com/Kinovarobotics/ros_kortex

## How to setup the network of KINOVA robot

This is an overview of the network setup process.
Refer to the documentation on [KINOVA resouce page](https://www.kinovarobotics.com/en/resources/technical-resources-library) if necessary.

Kinova can be connected with a computer via **USB, Ethernet and Wi-Fi**.

### Via USB

Micro-B USB to USB type-A cable is required.

1. Connect one end of the micro-B USB to type-A cable to the micro-B USB connector in the robot and connect the other end to the computer.
2. DHCP server on the robot base has worked correctly, and then the computer automatically is assigned an IP address. Try to connect to the robot via _Web App_ below. If not, you have to configure the computer RNDIS settings manually. See the steps below.
3. Open the network settings in your computer and set the IPv4 address:192.168.1.11 and Subnet mask:255.255.255.0.

### Via Ethernet
USB type-A to Ethernet adapter is required.

1. Connect an Ethernet cable to the robot by using the USB type-A to Ethernet adapter.
2. On your computer, open the network settings and set the IPv4 address:192.168.2.11 and Subnet mask:255.255.255.0.
3. Try to connect to the robot via _Web App_ below.

### Via Wi-Fi
Connecting your computer to ```133.11.xx.xxx``` is necessary.

1. Before you begin, you need to have a wired connection between the computer and the robot. **See the chapter Ethernet or USB and complete it** and see _Open Web App_ below.
2. Open Web App and connect to the robot.
3. Go to the Wireless & Networks page under the Configurations page.
4. You can see all of the detected Wi-Fi networks. Choose the networks you use, and fill in the required information.

### Open Web App
You can interact with the arm and perform basic tasks through an Web browser.

1. Confirm connecting the robot with a computer. From the web browser, enter the appropriate IP address for the arm base to access the Web App.
- 192.168.1.10 if connecting via USB
- 192.168.2.10 if connecting via Ethernet
- See the robot base if connecting via Wi-Fi. You can read xx.xx.xx...jp here.
2. Fill in the credentials in the login window and click CONNECT.

## How to setup development environment

### Conan Setup

You need to install `conan` (Decentralized, open-source (MIT), C/C++ package manager) to build kinova packages

```bash
sudo apt install python3 python3-pip
python3 -m pip install --user conan
conan config set general.revisions_enabled=1
conan profile new default --detect > /dev/null
conan profile update settings.compiler.libcxx=libstdc++11 default
```

### ROS Environment Setup

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

```bash
mkdir -p ~/kinova_ws/src
cd ~/kinova_ws/src
wstool init
wstool merge https://raw.githubusercontent.com/jsk-ros-pkg/jsk_robot/master/jsk_kinova_robot/kinova.rosinstall
wstool update
cd ../
source /opt/ros/melodic/setup.bash
rosdep install -y -r --from-paths src --ignore-src
catkin build jsk_kinova_startup kinovaeus
source devel/setup.bash
```

## Start ROS Node

Start real kinova robot. `ip_address` can be given by both ip address and FQDN (e.g. abc.def.jp)
Use the appropriate ip address according to the type of network you are using
The IP address is the same as when using Web App

```bash
# Gen3 robot
roslaunch jsk_kinova_startup kinova_bringup.launch ip_address:=xxxx
# Gen3 lite robot
roslaunch jsk_kinova_startup kinova_bringup.launch ip_address:=xxxx arm:=gen3_lite
```

Start rviz from different terminal

```bash
roslaunch jsk_kinova_startup rviz.launch
```

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

(load "package://kinovaeus/kinova-interface.l")
;; Gen3 with robotiq 2f 85 gripper
(kinova-init :type :gen3_robotiq_2f_85)
;; Gen3 with robotiq 2f 140 gripper
(kinova-init :type :gen3_robotiq_2f_140)
;; Gen3 Lite
(kinova-init :type :gen3_lite_gen3_lite_2f)
```

Use `:angle-vector` method to specify the arm joint angle.
```
(send *kinova* :angle-vector #f(0.0 15.0 180.0 -130.0 0.0 55.0 90.0))
```

You can also use `:inverse-kinematics` method to specify the arm pose from target coordinates.
```
(send *ri* :angle-vector (send *kinova* :arm :inverse-kinematics (make-coords :pos #f(300 0 200) :rpy (float-vector 0 pi/2 0)) :debug-view t) 3000)
```

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

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

To open/close gripper, you can use `start-grasp` and `stop-grasp` method.
```
(send *ri* :start-grasp)
(send *ri* :stop-grasp)
```

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

To obtain current robot pose, use :state :potentio-vector method.
```
(send *kinova* :arm :move-end-pos #f(0 0 -50))
```

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)
```

## Gazebo simulation
Kinova Gen3 robot with robotiq 2f 85 gripper.
```bash
# Terminal 1
roslaunch kortex_gazebo spawn_kortex_robot.launch arm:=gen3 gripper:=robotiq_2f_85 robot_name:=arm_gen3
# Terminal 2
roscd kinovaeus
roseus kinova-interface.l
(kinova-init :type :gen3_robotiq_2f_85)
```

Kinova Gen3 Lite robot with lite 2f gripper.
```bash
# Terminal 1
roslaunch kortex_gazebo spawn_kortex_robot.launch arm:=gen3_lite gripper:=gen3_lite_2f robot_name:=arm_gen3
# Terminal 2
roscd kinovaeus
roseus kinova-interface.l
(kinova-init :type :gen3_lite_gen3_lite_2f)
```

## Trouble shooting
- The robot doesn't work without errors in roseus and you see the following error in the terminal where you launched the launch file. TODO
- Turn off the power
- Make a posture that does not exceed the upper or lower limit of the joint angle
- Turn it back on
```bash
-----------------------------
Error #38
Type : TRAJECTORY_ERROR_TYPE_JOINT_POSITION_LIMIT
Identifier : TRAJECTORY_ERROR_IDENTIFIER_POSITION
Actuator : 3
Erroneous value is -150.149 but minimum permitted is -150.115 and maximum permitted is 150.115
Additional message is : Invalid Position - Position of actuator(2) in Trajectory Point (37) exceeds limits
-----------------------------
```
This error message above also can be seen in the topic `/arm_gen3/gen3_lite_joint_trajectory_controller/follow_joint_trajectory/result`.
- Joint limits are different from the ones in the URDF! This causes the problem above.
- See User guides(ex.[PDF:Gen3_Lite](https://artifactory.kinovaapps.com/artifactory/generic-documentation-public/Documentation/Gen3%20lite/Technical%20documentation/User%20Guide/Gen3_lite_USER_GUIDE_R03.pdf) pp.71-72)
- See URDF descriptions([gen3_7dof](https://github.com/Kinovarobotics/ros_kortex/blob/kinetic-devel/kortex_description/arms/gen3/7dof/urdf/gen3_macro.xacro), [gen3_6dof](https://github.com/Kinovarobotics/ros_kortex/blob/kinetic-devel/kortex_description/arms/gen3/6dof/urdf/gen3_macro.xacro), [gen3_lite](https://github.com/Kinovarobotics/ros_kortex/blob/kinetic-devel/kortex_description/arms/gen3_lite/6dof/urdf/gen3_lite_macro.xacro))

- Error in the initial movement in roseus (under investigation)
- When you used the robot by Web App and then tried to use it by roseus, it occured.
```bash
[ERROR] [1623300893.102460026]: Trajectory has been aborted.
[ERROR] [1623300893.102550198]: Trajectory execution failed in the arm with sub error code 69
The starting point for the trajectory did not match the actual commanded joint angles.
```
---
If you have any question, please feel free to file open at https://github.com/jsk-ros-pkg/jsk_robot/issues
37 changes: 37 additions & 0 deletions jsk_kinova_robot/jsk_kinova_startup/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
cmake_minimum_required(VERSION 2.8.3)
project(jsk_kinova_startup)

## 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)

###################################
## catkin specific configuration ##
###################################
catkin_package()

#############
## Install ##
#############
install(DIRECTORY config launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS)

#############
## Testing ##
#############
if(CATKIN_ENABLE_TESTING)
find_package(catkin REQUIRED COMPONENTS roslaunch roslint)

file(GLOB LAUNCH_FILES launch/*.launch)
# TODO: Do not do roslaunch_add_file_check()
# because upstream package (kortex_driver and kinova_vision) tests do not pass
# foreach(LAUNCH_FILE ${LAUNCH_FILES})
# roslaunch_add_file_check(${LAUNCH_FILE})
# endforeach()

set(ROSLINT_PYTHON_OPTS --max-line-length=180 --ignore=E221,E222,E241) # skip multiple spaces before/after operator
roslint_python()
roslint_add_test()
endif()
Loading