qqianfeng / panda-simulator

This provides the needed functionality for simulating the Franka Panda with the Hithand in Gazebo with ROS interface, providing exposed controllers and real-time robot state feedback similar to the real robot. Mirrored from https://github.com/justagist/panda_simulator.git.
Apache License 2.0
2 stars 0 forks source link

Panda Simulator

A Gazebo simulator for the Franka Emika Panda robot with ROS interface with the option to attach a DLR-HIT Hand II as end-effector, providing exposed controllers and real-time robot state feedback similar to the real robot when using the franka-ros package.

Installation Process

This section guides through the whole installation process, not only for the panda_hithand_simulator but for the full grasping system. This includes

Install Gazebo 9 from source

Install CUDA 10.1

Install ROS melodic

  1. sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  2. sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  3. sudo apt-get update
  4. sudo apt-get install ros-melodic-desktop
  5. echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
    source ~/.bashrc
  6. sudo apt-get install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
    sudo rosdep init
    rosdep update

Installing Libfranka and FrankaROS

  1. Install and build libfranka v0.6.0 from source
  1. Install and build Franka-ROS v0.6.0

Other dependencies

  1. sudo apt-get update && sudo apt-get install -q -y build-essential git swig sudo python-future libcppunit-dev python-pip
  2. sudo apt-get update && sudo apt-get install -y python-catkin-tools ros-melodic-gazebo-ros-control ros-melodic-rospy-message-converter ros-melodic-effort-controllers ros-melodic-position-controllers ros-melodic-joint-state-controller python-pip ros-melodic-moveit ros-melodic-moveit-commander ros-melodic-moveit-visual-tools ros-melodic-tf2-sensor-msgs ros-melodic-rosbridge-server ros-melodic-tf2-web-republisher ros-melodic-ros-control ros-melodic-moveit ros-melodic-trac-ik-kinematics-plugin ros-melodic-ros-numpy ros-melodic-trac-ik-python ros-melodic-image-proc ros-melodic-image-pipeline
    python3-pip
  3. pip install --upgrade pip
  4. sudo apt-get update && sudo apt-get upgrade -y

More Dependencies

  1. Install orocos-kinematics

    cd hithand_ws/src
    
    git clone https://github.com/qianbot/orocos-kinematics-dynamics.git
    
    cd orocos-kinematics-dynamics && git checkout b35c424e77ebc5b7e6f1c5e5c34f8a4666fbf5bc
    
    cd ../..
    
    catkin build orocos_kinematics_dynamics
    
  2. franka-ros-interface

    cd hithand_ws/src
    
    git clone https://github.com/qianbot/franka-ros-interface.git
    
    cd franka-ros-interface
    
    git checkout v0.6.0
    
    cd ../..
    
    catkin build franka_ros_interface -DFranka_DIR:PATH=/path/to/libfranka/build
  3. franka-panda-description

    cd hithand_ws/src
    
    git clone https://github.com/qianbot/franka-panda-description.git
    
    cd ..
    
    catkin build franka_panda_description -DFranka_DIR:PATH=/path/to/libfranka/build
  4. Hithand ros

    cd hithand_ws/src
    
    git clone https://github.com/qianbot/hithand_ros.git
    
    cd ..
    
    catkin build hithand_control hithand_gazebo hithand_description
  5. Robotiq ros

    
    sudo apt-get install -y ros-melodic-socketcan-interface ros-melodic-soem
    
    cd hithand_ws/src
    
    git clone https://github.com/davidmartinez13/robotiq
    cd ..
    
    catkin build robotiq
  6. Robotiq ros control pkg:

    cd hithand_ws/src
    
    git clone https://github.com/davidmartinez13/robotiq_3f_ros_pkg.git
    
    cd ..
    
    catkin build robotiq_3f_ros_pkg
  7. Trajectory smoothing

    cd hithand_ws/src
    
    git clone https://github.com/qianbot/trajectory-smoothing.git
    
    cd ..
    
    catkin build trajectory_smoothing
  8. Gazebo realsense plugin

    cd hithand_ws/src
    
    git clone https://github.com/qianbot/realsense-gazebo-plugin
    cd ..
    
    catkin build realsense_gazebo_plugin

Building the Package itself

Once the dependencies are met, the package can be installed using catkin build (preferred over catkin_make):

    source /opt/ros/$ROS_DISTRO/setup.bash

    cd hithand_ws/src

    git clone https://github.com/qianbot/panda-simulator.git

    cd ..

    catkin build panda_simulator -DFranka_DIR:PATH=/path/to/your/libfranka/build 
    # if catkin not found, install catkin tools (apt-get install python-catkin-tools)

    source devel/setup.bash

## Usage

- The simulator can be started by running:

    ```bash
    roslaunch panda_gazebo panda_hithand.launch
- or with the robotiq hand launch:
    ```bash
    roslaunch panda_gazebo panda_robotiq3f.launch
    ```

Grasping Pipeline

For the entire grasping pipeline you will need more packages

Installation

  1. Panda Hithand Moveit Config\ Clone the panda-hithand-moveit package also in the /src folder \

    cd hithand_ws/src
    
    git clone https://github.com/qianbot/panda-hithand-moveit-config.git
    
    cd ..
    
    catkin build panda_hithand_moveit_config
  2. Grasp pipeline\ Clone the grasp-pipeline package which provides the core grasping client-server functionality. \

    cd hithand_ws/src 
    
    git clone https://github.com/qianbot/grasp-pipeline.git
    
    cd ..
    
    catkin build grasp_pipeline
    
    pip install -r grasp-pipeline/misc/requirements.txt
  3. Bashrc Modifications\ For the whole system to work some modifications have to made to your .bashrc file. (This is analogous for other shells). Replace /path/to/your/hithand_ws with the path to your catkin workspace.

    echo "source /path/to/your/hithand_ws/devel/setup.bash" >> ~/.bashrc
  4. Make executabe\

    find /path/to/your/hithand_ws/src -type f -iname "*.py" -exec chmod +x {} \;
    
    find /path/to/your/hithand_ws/src -type f -iname "*.cpp" -exec chmod +x {} \;

Starting Procedure

The whole system gets started in the following order. Don't be too quick with executing the commands below and execute each of them in a seperate terminal.

  1. Start the panda_simulator \ roslaunch panda_gazebo panda_hithand.launch

    • or to start the panda_simulator with the robotiq hand:\ roslaunch panda_gazebo panda_robotiq3f.launch\
  2. Start the panda_hithand_moveit_config \ roslaunch panda_hithand_moveit_config panda_hithand_moveit.launch

    • or to spawn robotiq3f moveit with panda:\ roslaunch robotiq_3f_rviz_moveit_panda panda_robotiq3f_moveit.launch
  3. Start the grasp_pipeline. This exposes the the grasping servers. Currently this does not do anything in and of itself. But you can for example spawn objects in Gazebo \ roslaunch grasp_pipeline grasp_pipeline_servers.launch

    • or to Start the grasp_pipeline for robotiq3f:\ roslaunch grasp_pipeline grasp_pipeline_servers_robotiq.launch