Main Content

Install ROS Packages and Dependencies for ROS on External Computer

Note

This section describes the steps to be performed if the ROS is installed on an external computer than the one with MATLAB® installed. If the ROS and MATLAB are installed on the same computer, see Install ROS Packages and Dependencies for ROS.

This section describes the steps to be performed if the ROS is installed on an external computer than the one with MATLAB installed.

Kinova® Robotics provides a set of external ROS packages to communicate and control Gen3 robot. For more information on the individual packages, refer to this GitHub Page. Execute the following steps sequentially to clone required packages and install required dependencies on the computer which is connected to the robot and have ROS installed.

  1. Verify the OS version by executing the following command in the Linux® terminal.

    lsb_release -d

    The support package has been tested on Ubuntu 18.04 with ROS Melodic and Ubuntu 16.04 with ROS Kinetic.

  2. Verify the ROS version by executing the following command in the Linux terminal.

    rosversion -d

    If the ROS version is detected as <unknown>, then add ROS environment variables in your default bash shell launch script. Instructions to do the same are available under Section 1.5 of this webpage. If you are using ROS melodic, see this webpage instead.

  3. Install python3 and python3-pip by executing the following command in the Linux terminal.

    sudo apt install python3 python3-pip
  4. Install conan using pip and setup a default profile.

    sudo python3 -m pip install conan
    conan config set general.revisions_enabled=1
    conan profile new default --detect > /dev/null
    conan profile update settings.compiler.libcxx=libstdc++11 default
  5. Create a new workspace with src folder.

    mkdir -p kinova_ws/src
    cd kinova_ws
  6. Download the ros_kortex ROS packages (version 2.2.1) from GitHub achieve of Kinova Robotics.

    If you only have the access of Jetson™ board via SSH terminal, you can use wget command to download the ZIP archive and then use unzip command to extract the content into the src folder.

  7. Extract the contents of the ZIP file to the src folder. The src folder should contain ros_kortex-2.2.1 folder.

  8. Navigate to the workspace folder that you have created in step 5 (for example, kinova_ws). Install dependencies from the custom ROS packages by executing the following command in the Linux terminal.

    rosdep install --from-paths src --ignore-src -y
  9. Build the workspace using catkin tool. Additionally, if you are configuring a NVIDIA® Jetson compute board, append --cmake-args -DCONAN_TARGET_PLATFORM=jetson to the below command:

    catkin_make

    This will take a few minutes to complete.

  10. Ensure the connection with the robot over Wi-Fi® or Ethernet. If you are using the Ethernet port to connect with the robot, then configure your network adaptor to communicate with the robot. Refer to Set Up Network Adapter and Basic Network Ping for more details.

If you are using the Vision module, perform the setup instructions mentioned in the following section else go to Configure MATLAB for Custom ROS Message Definitions for Kinova Gen3.

Install Dependencies for Vision Module of Kinova Gen3 Robot

Kinova Robotics provides set of external ROS packages to acquire various image data from the vision module of Gen3 robot. For more information on the ROS packages, refer to this GitHub Page. Execute the following steps sequentially to clone required packages and install required dependencies.

  1. Install GStreamer and associated packages by executing the following command in the Linux terminal.

    sudo apt install gstreamer1.0-tools gstreamer1.0-libav libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-base
  2. Install rgbd launch ROS package.

    Note

    In the below command, you need to specify the correct ROS version, that is melodic or kinetic, according to your ROS installation version.

    sudo apt-get install ros-kinetic-rgbd-launch
  3. Navigate to the src folder that has been created in the Step 5 of the earlier setup process. Clone the required ROS packages in the src folder.

    git clone https://github.com/Kinovarobotics/ros_kortex_vision.git
  4. Build the workspace using catkin tool. This will take a few minutes to complete.

    catkin_make
    catkin_make install

Configure MATLAB for Custom ROS Message Definitions for Kinova Gen3

This section explains the steps to be performed on the computer which has MATLAB installed.

The ROS package kortex_driver supplied by Kinova Robotics contains custom ROS messages which are not part of the default message catalog of MATLAB. Hence, the message definition of these custom messages must be added to the MATLAB to communicate with the robot using ROS.

Pre-generated custom message definitions are included with this support package. The pre-configured message definitions are generated from the ROS package kortex_driver, as supplied by Kinova Robotics. If you want to modify the message definitions or create your own ROS package, which is dependent on kortex_driver, then refer to Add Custom ROS Message Definitions to MATLAB for more details on the workflow.

  1. Execute the following function to add custom ROS message definitions to message catalog.

    Status = codertarget.manipROSInterface.addCustomROSmsg('kinova');

If custom ROS message definitions are added to the ROS message catalog, the function returns true.

The setup is complete. Continue with the hardware setup screens and refer to the Read Current Joint Angles from KINOVA Gen3 Robot Arm example to acquire joint angles from the robot.

See Also

Related Topics