Skip to content

Latest commit

 

History

History
143 lines (92 loc) · 4.36 KB

xbox_teleop.md

File metadata and controls

143 lines (92 loc) · 4.36 KB

How to Control the robot by a Xbox/Playstation Joystick.


Installation

git clone https://github.com/inmo-jang/rain_ros.git

(2) univesral_robot

  • Install universal_robot using apt, as recommended in https://github.com/ros-industrial/universal_robot: "NOTE: please prefer using the binary release (see previous section) over building from source where possible. Source installs will not be automatically updated by new package releases and require more work to setup."
    sudo apt-get install ros-$ROS_DISTRO-universal-robot
  • replace $ROS_DISTRO with hydro, indigo or kinetic, depending on which ROS version you have installed.
  • Install ur_modern_driver (kinetic-devel),
    git clone https://github.com/inmo-jang/ur_modern_driver.git -b kinetic-devel

(4) Moveit (Kinetic)

sudo apt-get install ros-kinetic-moveit

(5-2) gazebo_ros_control (for gazebo operatoin)

sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control
git clone https://github.com/inmo-jang/moveit_jog_arm.git

(7) (Optional) robotiq (https://github.com/inmo-jang/robotiq)

git clone https://github.com/inmo-jang/robotiq.git
  • This package is needed to interface with a RobotiQ gripper.

If you encounter any problem in installation:

  • In most cases, that is because you miss some dependencies.
  • Try rosdep install --from-paths src --ignore-src -r -y

Execution

(1) UR5

  • Real
roslaunch ur_modern_driver ur5_ros_control.launch robot_ip:=172.22.22.2
  • Gazebo
roslaunch rain_gazebo ur5_robotiq.launch $(option)$
  • Available options:
    • camera:=true -- Provides 3 virtual cameras. (Default: false)
    • gripper:=robotiq_3f -- Use a 3-finger RobotiQ gripper. (Default: none)
      • You can interface with the gripper by topics right_hand/command and right_hand/state. The detail can be found in here -- Look Sec 4.4 and 4.5.
      • TODO : When you use this option, Moveit might not work well.

(2) Moveit

roslaunch rain_moveit_config moveit_planning_execution.launch
roslaunch rain_moveit_config moveit_rviz.launch config:=true
  • Move the robot to a normal position using Moveit (Otherwise, due to singularity, jog_arm does not work)

(3) Change ros_controller

  • (Option 1) position-based controller : You will send Cartesian delta information as a input
rosservice call /controller_manager/switch_controller "start_controllers:
- 'joint_group_position_controller'
stop_controllers:
- 'pos_based_pos_traj_controller'
strictness: 2"
  • (Option 2 - Only available for real robot) velocity-based controller : You will send Cartesian derivative information as a input (As of 1 Oct 2019, "gazebo_ros_control" is not fully support "VelocityJointInterface" - http://gazebosim.org/tutorials/?tut=ros_control)
rosservice call /controller_manager/switch_controller "start_controllers:
- 'joint_group_vel_controller'
stop_controllers:
- 'pos_based_pos_traj_controller'
strictness: 2"

(4) jog_arm

  • This is a launch file to use a xbox joystick for controlling the robot.
  • Set 'ur_config.yaml' depending on the controller you use, and run below
rosparam set joy_node/dev "/dev/input/jsX" (if necessary)
roslaunch moveit_jog_arm jog_with_xbox.launch
  • Note: You need to install joy package: http://wiki.ros.org/joy/Tutorials/ConfiguringALinuxJoystick.

  • Note: Even while you are pushing a button for a while, the robot may stop moving within a couple of seconds. This is because of incoming_command_timeout in yaml setting and the fact that joy only gives a topic even when you are pushing a button longer.