Skip to content

TriKnight/PBVS

Repository files navigation

Position-based visual servoing (PBVS)

license - apache 2.0 License Preprint

The research focuses on designing a system for position-based visual servoing (PBVS) with dual 6-Degree of Freedom (DoF) UR10e robots. The main robot uses computer vision integrated position-based servoing algorithm for tracking the ARTag trajectories from another robot by using Realsense D435 camera. The result of this algorithm is joint velocity control on the real UR10e robot, which helps the main robot simultaneously track the ARTag trajectories in real time.

Watch the video

1. PC Setup

https://github.com/UniversalRobots/Universal_Robots_ROS_Driver

git clone -b calibration_devel https://github.com/fmauch/universal_robot.git

sudo apt install ros-melodic-industrial-core

2. UR Robot setup

  • Go to folder ur_robot_driver/resources/
  • Install "external_control_1.04.urcap"
  • Version UR Techpendant controller: 5.9.1 Polyscope
  • Setting the IP for UR Robot: 192.168.1.101 DNS: 255.255.255.0 , and port 50002

3. Running command

3.1 Starting robot

  • Remember reduce speed when running the robot ~30%
Program --> URCap --> External Control 
Robot Program 
        |--> Control by <Your_PC_IP>

3.2 ROS PC

Setup your PC IP --> Static

Ros PC IP = 192.168.1.10 | NetMask: 255.255.255.0

Bringup the robot control driver

Don't forget to source the correct setup shell files and use a new terminal for each command!

roslaunch ur_robot_driver ur10e_bringup.launch robot_ip:=<Your_Robot_IP> 

Ex:

roslaunch ur_robot_driver ur10e_bringup.launch robot_ip:=192.168.1.101 

When you got the command Robot connected to reverse interface. Ready to receive control commands. . That mean your robot is already connected with your ROS-PC. Congratuation!

Pressing the Play on Techpendant to connect the robot to ROS-PC

Running the moveit interface

roslaunch ur10e_moveit_config ur10e_moveit_planning_execution.launch limited:=true 

When you got the command You can start planning now!. That the planning algorithms has been started.

  • Nextstep running the Moveit! config with RViz view roslaunch dense_grasp ur10_rviz.launch

Usage with Gazebo Simulation
There are launch files available to bringup a simulated robot - either UR5e or UR10e. In the following the commands for the UR10e are given. For the UR5, simply replace the prefix accordingly.

To bring up the simulated robot in Gazebo, run:

roslaunch ur_gazebo ur10e_bringup.launch

MoveIt! with a simulated robot
Again, you can use MoveIt! to control the simulated robot.

For setting up the MoveIt! nodes to allow motion planning run:

roslaunch ur10e_moveit_config ur10e_moveit_planning_execution.launch sim:=true

For starting up RViz with a configuration including the MoveIt! Motion Planning plugin run:

roslaunch dense_grasp ur10_rviz.launch

Creating the new workspace of robot Run the the UR10e robot with rg2 gripper workspace roslaunch dense_grasp ur10e_rg2_workspace.launch

UR robots node graph show
The move_group node is connecting to the ur_hardware_interface via the subscribed tf topic /tf, that is help ROS-PC can get the current position of the robot when it power on mode. The topic /scaled_pos_joint_traj_controller/follow_joint_trajectory/goal is sent to node ur_hardware_interface by node move_group, that is help the robot running by following trajectories is generated by Moveit!.

Up position UR10e

3.3 Control the robotics arm

Test Forward Kinematic with Position Joint Trajectories Control

Running the code below. The robot will running by each position of joint in amount of time.

rosrun dense_grasp pos_joint_traj.py

Test inverse kinematic robotics arm

 roslaunch dense_grasp ur10e_workspace.launch
 roslaunch ur10e_moveit_config ur10e_moveit_planning_execution.launch sim:=true
 roslaunch dense_grasp ur10_rviz.launch
 rosrun dense_grasp move_group_tutorial
 rosrun dense_grasp move_group_tutorial_py.py

Test Velocity Joint Trajectories Control (Not working)

 roslaunch dense_grasp ur10e_vel_control.launch
 roslaunch ur10e_moveit_config ur10e_moveit_planning_execution.launch sim:=true
 roslaunch dense_grasp ur10_rviz.launch
 rosrun dense_grasp vel_joint_traj.py 

Velocity controller

Switch the position controller to velocity controller

rosservice call /controller_manager/switch_controller "start_controllers: ['joint_group_vel_controller']
stop_controllers: ['scaled_pos_joint_traj_controller']
strictness: 2
start_asap: false
timeout: 0.0"

Test the velocity controller by publish 1 time message. The joint following list "shoulder_pan_joint > shoulder_lift_joint > elbow_joint > wrist_1_joint > wrist_2_joint > wrist_3_joint"

Testing the wrist 3 joint rotation

rostopic pub -1 /joint_group_vel_controller/command std_msgs/Float64MultiArray "layout: 
  dim:
  - label: ''
    size: 0
    stride: 0
  data_offset: 0
data: [0.0, 0.0,0.0,0.0,0.0,0.001]"
rostopic pub -1 /joint_group_vel_controller/command std_msgs/Float64MultiArray "layout: 
  dim:
  - label: ''
    size: 0
    stride: 0
  data_offset: 0
data: [0.0, 0.0,0.0,0.0,0.0,0.0]"

Troubleshooting

rostopic list

...
/scaled_pos_joint_traj_controller/command
/scaled_pos_joint_traj_controller/follow_joint_trajectory/cancel
/scaled_pos_joint_traj_controller/follow_joint_trajectory/feedback
/scaled_pos_joint_traj_controller/follow_joint_trajectory/goal
/scaled_pos_joint_traj_controller/follow_joint_trajectory/result
/scaled_pos_joint_traj_controller/follow_joint_trajectory/status
/scaled_pos_joint_traj_controller/state
/speed_scaling_factor
....

Up Position of UR

Up position UR10e

## joint name
joint_names: [elbow_joint, shoulder_lift_joint, shoulder_pan_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint]
## home position of each joints
positions: [0, -pi/2, 0, -p/2, 0, 0]

1. Connection Error between UR and ROS_PC

If you get Connection Error: The connection to the remote PC at 192.168.1.10:50002 could not be established. Reason: No route to host.

  1. In PolyScope/ UR Teach Pendant. Go to Installation/FeildBus --> Disable all Modbus, Ethernet/IP, ProfiNet. When you disable Ethernet/IP the On-Robot Gripper can not work, that mean after you run the roslaunch ur_bringup you can enable the Ethernet/IP to communicate with Robot again.
  2. Please go to the installation and config another IP address in UR and PC setting, ex: 192.168.1.11:50002

Error

When we run the python code

rosrun dense_grasp move_group_tutorial.py 
ImportError: dynamic module does not define module export function (PyInit__moveit_roscpp_initializer)

Solve: conda deactivate

About

The ROS package focuses on designing a system for position-based visual servoing (PBVS)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published