All Projects → Geonhee-LEE → ur-reaching-reinforcement-learning

Geonhee-LEE / ur-reaching-reinforcement-learning

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

Programming Languages

python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to ur-reaching-reinforcement-learning

ws moveit
This ROS melodic workspace is created on Ubuntu 18.04. Here I worked on moveit & MTC projects like Pick, Place, Pouring task for multi-manipulator system using MoveIt Task Constructor(MTC).
Stars: ✭ 25 (-52.83%)
Mutual labels:  moveit, moveit-api
arm
Robot arm simulation using Gazebo, ROS Control and MoveIt.
Stars: ✭ 79 (+49.06%)
Mutual labels:  moveit, gazebo
open manipulator simulations
ROS Simulation for OpenManipulator
Stars: ✭ 15 (-71.7%)
Mutual labels:  moveit, gazebo
ur ws
Universal robot with robotiq hand workspace
Stars: ✭ 21 (-60.38%)
Mutual labels:  moveit, gazebo
motoman project
Repository for Motoman ROS applications
Stars: ✭ 50 (-5.66%)
Mutual labels:  moveit, gazebo
PROBOT Anno
ROS Packages for PROBOT Anno.
Stars: ✭ 75 (+41.51%)
Mutual labels:  moveit, gazebo
GazeboWorldDesigner
A visual tool for laying out Gazebo simulation world files.
Stars: ✭ 12 (-77.36%)
Mutual labels:  gazebo
ardupilot gazebo
Repository for ArduPilot & Gazebo Software In Loop Simulation Interfaces, Models
Stars: ✭ 52 (-1.89%)
Mutual labels:  gazebo
ign-physics
Abstract physics interface designed to support simulation and rapid development of robot applications.
Stars: ✭ 40 (-24.53%)
Mutual labels:  gazebo
gazebo tutorials
Tutorials for gazebo
Stars: ✭ 78 (+47.17%)
Mutual labels:  gazebo
RoboticsAcademy
Learn Robotics with JdeRobot
Stars: ✭ 160 (+201.89%)
Mutual labels:  gazebo
ar-tu-do
ROS & Gazebo project for 1/10th scale self-driving race cars
Stars: ✭ 65 (+22.64%)
Mutual labels:  gazebo
ign-math
General purpose math library for robot applications.
Stars: ✭ 35 (-33.96%)
Mutual labels:  gazebo
terrain generator
A wizard that generates terrains for Gazebo using height maps.
Stars: ✭ 46 (-13.21%)
Mutual labels:  gazebo
smart grasping sandbox
A public sandbox for Shadow's Smart Grasping System
Stars: ✭ 69 (+30.19%)
Mutual labels:  gazebo
Autonomus Indoor Drone
Final year project, autonomus indoor drone developed in ROS using DWM1001 dev-board
Stars: ✭ 26 (-50.94%)
Mutual labels:  gazebo
ur5controller
OpenRAVE Controller Plugin for UR5 (Universal Robots UR5) Robot
Stars: ✭ 21 (-60.38%)
Mutual labels:  ur5
ur5
UR5 Robot with a Robotiq gripper
Stars: ✭ 77 (+45.28%)
Mutual labels:  ur5
linorobot2
Autonomous mobile robots (2WD, 4WD, Mecanum Drive)
Stars: ✭ 97 (+83.02%)
Mutual labels:  gazebo
gzweb
Web client for Gazebo classic simulation
Stars: ✭ 36 (-32.08%)
Mutual labels:  gazebo

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].