• Stars
    star
    118
  • Rank 299,923 (Top 6 %)
  • Language
    Python
  • Created over 5 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reinforcement learning using rlkit, UR5, Robotiq gripper on ROS(Robot Operating System)

Object tracking video using Reinforcement learning

Object tracking video using Reinforcement learning

How to launch original env

First launch the simulator

roslaunch ur_robotiq_gazebo gym.launch

And run the training launch

roslaunch ur_training default.launch

Conveyer GAZEBO env

First launch the gazebo and gym interface and node publishing block point.

roslaunch ur_robotiq_gazebo conveyer_gym.launch --screen

Run the RL algorithms and unpause the GAZEBO

roslaunch ur_training default.launch

Latest block's point:

rostopic echo /target_blocks_pose

Total block's points:

rostopic echo /blocks_poses 

How to launch REINFORCE algorithm

First launch the simulator

roslaunch ur_robotiq_gazebo conveyer_gym.launch controller:=vel --screen gui:=false

And load the parameters and launch python file for reset

roslaunch ur_reaching reinforcement.launch

And start the learning algorithm

python reinforcement_main.py 

And unpause physics of GAZEBO simulator

rosservice call /gazebo/unpause_physics "{}"

How to launch PPO+GAE algorithm

First launch the simulator including loading the parameters and GAZEBO Excution func

roslaunch ur_robotiq_gazebo conveyer_gym.launch --screen gui:=false

And start the learning algorithm

 python ppo_gae_main.py

How to use the RLkit

RLkit is reinforcement learning framework based on rllab

Run GAZEBO simulator and gazebo_execution

First launch the simulator including loading the parameters and GAZEBO Excution func

roslaunch ur_robotiq_gazebo conveyer_gym.launch --screen gui:=false

Training

And start the SAC learning algorithm based on RLkit

 python rlkit_sac_main.py

And unpause physics of GAZEBO simulator

rosservice call /gazebo/unpause_physics "{}"

After training, you may find the pickled files on the rlkit/data folder.

you can easily see the results through selecting the generated folder about training like follwing:

python viskit/frontend.py ../rlkit/data/SAC/SAC_2019_10_14_08_27_55_0000--s-0/

Evaluation

If you want to evaluate the trained weight, you can run like following:

python rlkit/scripts/run_policy.py rlkit/data/SAC/SAC_2019_10_14_08_27_55_0000--s-0/params.pkl 

Visualization

  • Rviz
roslaunch ur_robotiq_moveit_config  moveit_rviz.launch 
  • rviz_visual_tools
rosrun visual_tools rviz_visual_tools_demo

Visualization

  • moveit_visual_tools
rosrun visual_tools moveit_visual_tools_demo

Services

  • /gazebo/unpause_physics (Empty)
    • Unpause GAZEBO simulator for starting
    rosservice call /gazebo/unpause_physics "{}"
    
  • /set_velocity_controller (SetBool)
    • Set velocity controllers including 6 velocity controllers after stoppint velocity_controller/JointTrajectoryController
  • /set_trajectory_velocity_controller (SetBool)
    • Set velocity trajectory controller including Joint trajectory controllers after stopping velocity_controller/JointVelocityController
  • /stop_training (SetBool)
    • Stop training process
  • /start_training (SetBool)
    • Start training process

Helpful function

We can check the controller manager status using following:

rosrun rqt_controller_manager rqt_controller_manager

controller manager

Universal Robot

Usage with real Hardware
There are launch files available to bringup a real robot - either UR5 or UR10.
In the following the commands for the UR5 are given. For the UR10, simply replace the prefix accordingly.

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

To bring up the real robot, run:

roslaunch ur_modern_driver ur5_bringup.launch robot_ip:=192.168.0.3

MoveIt! with real Hardware and gripper
To run the MoveIt with gripper, run

roslaunch total_moveit_config total_moveit_planning_execution.launch

MoveIt API Python execution!

rosrun ur_robotiq_moveit_api ur_robotiq_moveit.py

A simple test script that moves the robot to predefined positions can be executed like this:

rosrun ur_driver test_move.py

CAUTION:
Remember that you should always have your hands on the big red button in case there is something in the way or anything unexpected happens.

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

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

To bring up the simulated robot in Gazebo, run:

roslaunch ur_gazebo ur5.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 ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true

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

roslaunch ur5_moveit_config moveit_rviz.launch config:=true

NOTE:
As MoveIt! seems to have difficulties with finding plans for the UR with full joint limits [-2pi, 2pi], there is a joint_limited version using joint limits restricted to [-pi,pi]. In order to use this joint limited version, simply use the launch file arguments 'limited', i.e.:

roslaunch ur_gazebo ur5.launch limited:=true

roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true limited:=true

roslaunch ur5_moveit_config moveit_rviz.launch config:=true


MoveIt! with real Hardware
Additionally, you can use MoveIt! to control the robot.
There exist MoveIt! configuration packages for both robots.

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

roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch

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

roslaunch ur5_moveit_config moveit_rviz.launch config:=true

NOTE:
As MoveIt! seems to have difficulties with finding plans for the UR with full joint limits [-2pi, 2pi], there is a joint_limited version using joint limits restricted to [-pi,pi]. In order to use this joint limited version, simply use the launch file arguments 'limited', i.e.:

roslaunch ur_bringup ur5_bringup.launch limited:=true robot_ip:=IP_OF_THE_ROBOT [reverse_port:=REVERSE_PORT]

roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch limited:=true

roslaunch ur5_moveit_config moveit_rviz.launch config:=true

More Repositories

1

mpc_ros

Differential Wheeled Mobile Robot - Nonlinear Model Predictive Control based on ROS
C++
742
star
2

mpc_ros_description

Supports the various URDF and GAZEBO mobile robot model
CMake
46
star
3

jinyoung-manipulator-detection-and-grasping

The repository is for developing manipulator which can recognize the objects via image processing. The Jinyoung wants to grasp some objects with Opencv, ROS, MoveIt, and so on.
C++
11
star
4

autonomous-vehicle-MDS

Implementation of autonomous vehicle using ROS
Python
8
star
5

mobile_robot_control

Robot control with Traditional control and Optimal control and Learning-based control
Python
8
star
6

ur5-pick-and-place

Python
5
star
7

control-robotics-machine-learning

Arrange the files and contents about robotics and control theory such as optimal, nonlinear, underactuated control, etc.
5
star
8

ur5_ros_gym

Python
4
star
9

local_planner

4
star
10

mobilerobot_rl

This repository is about Reinforcement learning of Machine leaning for mobile robot
Python
4
star
11

rl_sawyer

Reaching to the goal task based on model-free RL using sawyer based on ROS
Python
3
star
12

fake_localization

A ROS node that simply forwards odometry information.
C++
2
star
13

nscl-mobilerobot-mcu

C++
1
star
14

replab-rlkit-viskit

Bring the rlkit, viskit packages from Docker image of REPLAB to implement RL algorithms
Python
1
star
15

geon.github.io

The individual homepage
1
star
16

tf2_practice

CMake
1
star
17

reinforcemnet-learning

Arrangement of data about RL
1
star
18

yolact_ros_msgs

CMake
1
star
19

kros_summer2018

Jupyter Notebook
1
star
20

yolo_torch

We want to use the yolo_v3 using Pytorch on the ROS(Robot Operating System)
Python
1
star
21

nscl-mobilerobot-ros

C++
1
star
22

docker_images

This repository consist of various image that contain Dockerfile
1
star
23

balancing_robot

C++
1
star
24

deep-q-learning-maze

Python
1
star
25

hiwin_pkg

C++
1
star
26

Docker_Jenkins

Docker_Jenkins
1
star
27

machine-learning

1
star
28

cs294-hw

Python
1
star
29

object-detection-opencv3-ros

Image processing using opencv for Labeling and HSV, tracking algorithm
C++
1
star