Git Product home page Git Product logo

mujoco_rl_ur5's Introduction

Accompanying repository of Master's thesis at TU Berlin / Aalborg University. No longer under active development. Developed in my earlier Python days, please forgive the unformatted spaghetti code.

Deep Reinforcement Learning for robotic pick and place applications using purely visual observations

Author: Paul Daniel ([email protected])

Traits of this environment: Very large and multi-discrete actionspace, very high sample-cost, visual observations, binary reward.

Trained agent in action Example of predicted grasp chances
Setup iteration Relevant changes
IT5 - Many more objects, randomly piled
- Actionspace now multi-discrete, with second dimension being a rotation action
IT4 - Z-coordinate for grasping now calculated using depth data
- Objects now vary in size
IT3 - New two-finger gripper implemented
IT2 - Grasp success check now after moving to drop location (1000 steps)
IT1 (Baseline) - Grasp success check after moving straight up (500 steps of trying to close the gripper)
- Fixed z-coordinate for grasping
- Objects of equal size

This repository provides several python classes for control of robotic arms in MuJoCo:

  • MJ_Controller: This class can be used as a standalone class for basic robot control in MuJoCo. This can be useful for trying out models and their grasping capabilities. Alternatively, its methods can also be used by any other class (like a Gym environment) to provide some more functionality. One example of this might be to move the robot back into a certain position after every episode of training, which might be preferable compared to just resetting all the joint angles and velocities. The controller currently also holds the methods for image transformations, which might be put into another separate class at some point.

  • GraspEnv: A Gym environment for training reinforcement learning agents. The task to master is a pick & place task. The difference to most other MuJoCo Gym environments is that the observation returned is a camera image instead of a state vector of the simulation. This is meant to resemble a real world setup more closely.

The robot configuration used in this setup (Universal Robots UR5 + Robotiq S Model 3 Finger Gripper) is based on this resource. It has since been heavily modified. Most current XML-file: UR5gripper_2_finger.xml
The python bindings used come from mujoco_py.
The PID controllers implemented are based on simple_pid.
A simple inverse kinematics solver for translating end-effector positions into joint angles has been implemented using ikpy.

The required modules can be installed either manually or using the provided requirements.txt - file.

Setup

Download and install MuJoCo from here. Set up a license and activate it here.

Then clone this repo:

git clone https://github.com/PaulDanielML/MuJoCo_RL_UR5.git

Then change into the newly created directory:

cd MuJoCo_RL_UR5/

If desired, activate a virtual environment, then run

pip install -r requirements.txt

This will install all required packages using pip. The first time you run a script that uses the Mujoco_UR5_controller class some more setup might happen, which can take a few moments. This is all the setup required to use this repo.

Usage

GraspEnv - class:

Gym-environment for training agents to use RGB-D data for predicting pixel-wise grasp success chances.
The file example_agent.py demonstrates the use of a random agent for this environment.
The file Grasping_Agent.py gives an example of training a shortsighted DQN-agent in the environment to predict pixel-wise grasping success (PyTorch). The created environment has an associated controller object, which provides all the functionality of the MJ_Controller - class to it.

  • Action space: Pixel space, can be specified by setting height and width. Current defaults: 200x200. This means there are 40.000 possible actions. This resolution translates to a picking accuracy of ~ 4mm.
  • State space: The states / observations provided are dictionaries containing two arrays: An RGB-image and a depth-image, both of the same resolution as the action space
  • Reward function: The environment has been updated to a binary reward structure:
    • 0 for choosing a pixel that does not lead to a successful grasp.
    • +1 for choosing a pixel that leads to a successful grasp.

The user gets a summary of each step performed in the console. It is recommended to train agents without rendering, as this will speed up training significantly.

console

The rgb part of the last captured observation will be shown and updated in an extra window.

observation

MJ_Controller - class:

Example usage of some of the class methods is demonstrated in the file example.py.

The class MJ_Controller offers high and low level methods for controlling the robot in MuJoCo.

  • move_ee : High level, moves the endeffector of the arm to the desired XYZ position (in world coordinates). This is done using very simple inverse kinematics, just obeying the joint limits. Currently there is not collision avoidance implemented. Since this whole repo is created with grasping in mind, the delivered pose will always be so that the gripper is oriented in a vertical way (for top down grasps).
  • actuate_joint_group : Low level, lets the user specify motor activations for a specified group
  • grasp : Uses the specified gripper group to attempt a grasp. A simple check is done to determine weather the grasp was successful or not and the result will be output blinking in the console.

gif1

Updates

Trials for Offline RL: The folder Offline RL contains scripts for generating and learning from a dataset of (state, action, reward)-transitions. generate_data.py can be used to generate as many files as required, each file containing 12 transitions.

New gripper model available: A new, less bulky, 2-finger gripper was implemented in the model in training setup iteration 3.

new_gripper

Image normalization: Added script normalize.py, which samples 100 images from the environment and writes the mean values and standard deviations of all channels to a file.

Reset shuffle: Calling the environments step method now rearranges all the pickable objects to random positions on the table.

gif2

Record grasps: The step method of the GraspingEnv now has the optional parameter record_grasps. If set to True, it will capture a side camera image every time a grasp is made that is deemed successful by the environment. This allows for "quality control" of the grasps, without having to watch all the failed attempts. The captured images can also be useful for fine tuning grasping parameters.

grasp

Point clouds: The controller class was provided with new methods for image transformations.

  • depth_2_meters: Converts the normalized depth values returned by mujoco_py into m.
  • create_camera_data: Constructs a camera matrix, focal length and sets the camera's position and rotation based on a provided camera name and desired image width and depth.
  • world_2_pixel: Accepts a XYZ world position and returns the corresponding x-y pixel coordinates
  • pixel_2_world: Accepts x-y pixel coordinates and a depth value, returns the XYZ world position. This method can be used to construct point clouds out of the data returned by the controllers get_image_data method.

cloud

Joint plots: All methods that move joints now have an optional plot parameter. If set to True, a .png-file will be created in the local directory. It will show plots for each joint involved in the trajectory, containing the joint angles over time, as well as the target values. This can be used to determine which joints overshoot, oscillate etc. and adjust the controller gains based on that.
The tolerance used for the trajectory are plotted in red, so it can easily be determined how many steps each of the joints needs to reach a value within tolerance.

plot1

mujoco_rl_ur5's People

Contributors

pauldanielml avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mujoco_rl_ur5's Issues

cannot import name 'debug'

Hello, I run the command: python Grasping_Agent.py, in my conda virtual env(python3.6), facing an issue as below:

File "/home/wu/github_resource/MuJoCo_RL_UR5/gym_grasper/envs/GraspingEnv.py", line 19, in
from decorators import debug
ImportError: cannot import name 'debug'

my environment should be ok, ubuntu18.04, mujoco_py2.0, gym, and other ones required, like your requirements.txt

and the decorators module has been installed.

I search some messages by google, but useful ones are few.

so, how can I do to figure out this issue.

could you give me some suggestions, thank you~~

Failed to initialize OpenGL

Hi @PaulDanielML ,
I am trying to use your simulator in a project related to imitation learning. I installed the simulator according to instructions. Then I am trying to run example_agent.py but its giving me the error mentioned below.

File "/home/himanshu/MuJoCo_RL_UR5/gym_grasper/controller/MujocoController.py", line 719, in get_image_data
    self.sim.render(width=width, height=height, camera_name=camera, depth=False)
  File "mjsim.pyx", line 156, in mujoco_py.cymj.MjSim.render
  File "mjsim.pyx", line 158, in mujoco_py.cymj.MjSim.render
  File "mjrendercontext.pyx", line 46, in mujoco_py.cymj.MjRenderContext.__init__
  File "mjrendercontext.pyx", line 114, in mujoco_py.cymj.MjRenderContext._setup_opengl_context
  File "opengl_context.pyx", line 130, in mujoco_py.cymj.OffscreenOpenGLContext.__init__
RuntimeError: Failed to initialize OpenGL

gym.make(), the 'observation_space' is needed.

Hi, I have configured your repo, and when i run example_agent.py, the init function of gym.make() reported: the 'observation_space' must be the required argument. Could you please tell me how can i define the space? thanx~

RuntimeError: Failed to initialize OpenGL

Does anyone know how to solve this problem?

(mujoco_py) xxxx@XXXX:~/.mujoco/mujoco-py/examples/MuJoCo_RL_UR5$ python3 example_agent.py
Creating window glfw
Created new control group 'Arm'.
Created new control group 'Gripper'.
Model timestep: 0.002
Set number of frames skipped: 1
dt = timestep * frame_skip: 0.002
Frames per second = 1/dt: 500
Actionspace: MultiDiscrete([40000 6])
Observation space: Dict(rgb:Box(200, 200, 3), depth:Box(200, 200))
Found 1 GPUs for rendering. Using device 0.
Could not make EGL context current
Traceback (most recent call last):
File "example_agent.py", line 16, in
obs = env.reset()
File "/home/xxxx/anaconda3/envs/mujoco_py/lib/python3.8/site-packages/gym/envs/mujoco/mujoco_env.py", line 108, in reset
ob = self.reset_model()
File "/home/xxxx/.mujoco/mujoco-py/examples/MuJoCo_RL_UR5/gym_grasper/envs/GraspingEnv.py", line 477, in reset_model
return self.get_observation(show=self.show_observations)
File "/home/xxxx/.mujoco/mujoco-py/examples/MuJoCo_RL_UR5/gym_grasper/envs/GraspingEnv.py", line 398, in get_observation
rgb, depth = self.controller.get_image_data(
File "/home/xxxx/.mujoco/mujoco-py/examples/MuJoCo_RL_UR5/gym_grasper/controller/MujocoController.py", line 719, in get_image_data
self.sim.render(width=width, height=height, camera_name=camera, depth=True)
File "mjsim.pyx", line 156, in mujoco_py.cymj.MjSim.render
File "mjsim.pyx", line 158, in mujoco_py.cymj.MjSim.render
File "mjrendercontext.pyx", line 46, in mujoco_py.cymj.MjRenderContext.init
File "mjrendercontext.pyx", line 114, in mujoco_py.cymj.MjRenderContext._setup_opengl_context
File "opengl_context.pyx", line 130, in mujoco_py.cymj.OffscreenOpenGLContext.init
RuntimeError: Failed to initialize OpenGL

Running example.py

Hello
Running the example code throws out an error saying inverse kinematics is not possible for the coordinates

Attribute error - sim

Hi,
I just found an error message "AttributeError: 'GraspEnv' object has no attribute 'sim'" when I ran the command "python3 Grasping_Agent_multidiscrete.py".

Traceback is shown as follows:

Traceback (most recent call last):
File "Grasping_Agent_multidiscrete.py", line 583, in
main()
File "Grasping_Agent_multidiscrete.py", line 521, in main
agent = Grasp_Agent(seed=rand_seed, load_path=None, learning_rate=lr, depth_only=False)
File "Grasping_Agent_multidiscrete.py", line 85, in init
self.env = gym.make(
File "/home/steve/anaconda3/envs/mujoco_py/lib/python3.8/site-packages/gym/envs/registration.py", line 592, in make
env = env_creator(**_kwargs)
File "/home/steve/MuJoCo_RL_UR5/gym_grasper/envs/GraspingEnv.py", line 51, in init
self.controller = MJ_Controller(self.model, self.sim, self.viewer)
AttributeError: 'GraspEnv' object has no attribute 'sim'

Appreciate!

Real UR5 Control

Hi Thank you for sharing your grateful project!

I want to validate performance of the weight through reinforcement learning on simulator with real UR Robot.

  1. Is it right to use test.py with weight earned by simulator?
  2. To test.py, Is it right that the work connecting ros and moveit should proceed ahead?

Grasping_Agent_multidiscrete.py, example_agent.py errors

Hi all, i have two errors, when i used codes. How can i solve them. Thx for informations.

python3 example_agent.py
.
.
.
EPISODE 1 STEP 1
#################################################################
Traceback (most recent call last):
File "example_agent.py", line 27, in
observation, reward, done, _ = env.step(action, record_grasps=True)
TypeError: step() got an unexpected keyword argument 'record_grasps'

Then i tried grasping agent code and ..

python3 Grasping_Agent_multidiscrete.py
Creating window glfw
Created new control group 'Arm'.
Created new control group 'Gripper'.
CURRENT EPSILON: 1.0
#################################################################
EPISODE 1 STEP 1
#################################################################
Traceback (most recent call last):
File "Grasping_Agent_multidiscrete.py", line 583, in
main()
File "Grasping_Agent_multidiscrete.py", line 545, in main
next_state, reward, done, _ = agent.env.step(
TypeError: step() got an unexpected keyword argument 'action_info'

Project dependencies may have API risk issues

Hi, In MuJoCo_RL_UR5, inappropriate dependency versioning constraints can cause risks.

Below are the dependencies and version constraints that the project is using

mujoco_py
numpy
simple_pid
termcolor
ikpy
pyquaternion
opencv-python
matplotlib
gym

The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict.
The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

After further analysis, in this project,
The version constraint of dependency numpy can be changed to >=1.8.0,<=1.23.0rc3.

The above modification suggestions can reduce the dependency conflicts as much as possible,
and introduce the latest version as much as possible without calling Error in the projects.

The invocation of the current project includes all the following methods.

The calling methods from the numpy
numpy.linalg.inv
The calling methods from the all methods
numpy.round
agent.optimizer.state_dict
numpy.min
self.viewer.render
self.controller.pixel_2_world
self.policy_net.load_state_dict
self.standardize_rgb
max_value.item
collections.defaultdict
numpy.concatenate
depth_list.append
depth_tensor.detach.clone
self.optimizer.zero_grad
torch.optim.Adam
abs
self.controller.depth_2_meters
device.state.to.self.policy_net.view
torchvision.transforms.Normalize
Grasp_Agent.learn
fig.add_subplot.set_ylabel
str
parameter.numel
pixel.np.round.astype
AverageMeter.update
Modules.MULTIDISCRETE_RESNET.to.eval
self.ee_chain.inverse_kinematics
model.named_parameters
torch.optim.Adam.zero_grad
self.bn3
collections.defaultdict.append
targets.positive_predection.int
data.unsqueeze
collections.deque
numpy.sqrt
self.standardize_depth
matplotlib.pyplot.subplots_adjust
numpy.array.flatten
self.ee_chain.forward_kinematics
gym_grasper.controller.MujocoController.MJ_Controller.move_ee
self.add_marker
self.UP2
targets.sum.item
gym.spaces.MultiDiscrete
agent.env.step
Grasping_Agent_multidiscrete.Grasp_Agent.update_tensorboard
mujoco_py.load_model_from_path
agent.writer.close
kwargs.items
open
max_idx.view.view
self.standardize_depth.detach
conv2d_size_out
Grasping_Module_multidiscrete
grad.view.cpu
pickle.loads
self.policy_net.state_dict
self.render
torch.load.keys
self.last_1000_rewards.append
collections.defaultdict.items
self.model.actuator_id2name
idx_list.append
self.bn2
gym_grasper.controller.MujocoController.MJ_Controller.toss_it_from_the_ellbow
gym.make.reset
self.plot_list.append
torch.nn.Sequential
controller
self.writer.add_scalars
sys.path.insert
math.radians
pyquaternion.Quaternion.random
self.target_net.eval
Grasping_Agent_multidiscrete.Grasp_Agent
abs.dot
torch.optim.Adam.step
gym.utils.EzPickle.__init__
rgb_list.append
Grasping_Agent_multidiscrete.Grasp_Agent.transform_action
format
time.strftime
test
torchvision.transforms.ToTensor
torch.nn.functional.binary_cross_entropy.backward
end_idx.start_idx.batch.action.torch.cat.to
self.model.actuator_id2name.append
Perception_Module
torch.device
self.Grasping_Module_multidiscrete.super.__init__
self.C1
self.RB1
ValueError
torch.optim.Adam.load_state_dict
torchvision.transforms.ColorJitter
simple_pid.PID
self.get_mean_std
self.viewer.add_marker
Modules.ReplayBuffer
gym.envs.mujoco.mujoco_env.MujocoEnv.close
torch.randn_like
self.rotate_wrist_3_joint_to_value
self.env.controller.pixel_2_world
fmtstr.format
prettytable.PrettyTable
numpy.flipud
torch.utils.tensorboard.SummaryWriter.add_scalar
rewards.append
torch.zeros
numpy.fliplr
Transition
pickle.dump
fig.add_subplot.plot
self.controller.set_group_joint_target
self.controller.stay
self.writer.add_scalar
cv2.imwrite
torch.optim.SGD
copy.deepcopy
policy_net
self.BasicBlock.super.__init__
torch.nn.functional.relu
inspect.signature
axis.yaxis.set_label_coords
torch.nn.Linear
matplotlib.pyplot.clf
zip
numpy.linalg.inv
self.C1.size
self.fc1
self.controller.move_group_to_joint_target
self.model.camera_name2id
func
norm_layer
termcolor.colored
self.normal_rgb_no_jitter_no_noise
self.env.model.camera_name2id
matplotlib.pyplot.savefig
max_idx.view.unsqueeze_
conv3x3
agent.policy_net.state_dict
random.randrange
i.self.actuators.self.plot_list.append
func.keys
targets.sum
int
self.ee_chain.inverse_kinematics_frame
range
self.CONV3_FC1.super.__init__
axis.xaxis.set_label_coords
torch.nn.MaxPool2d
numpy.ones
gym.envs.registration.register
data.len.state_batch.policy_net.view.gather
self.close_gripper
self.n_actions_2.MULTIDISCRETE_RESNET.to
self.HEIGHT.self.WIDTH.torch.zeros.to
self.create_group
resnet
isinstance
numpy.max
numpy.tan
state_batch.policy_net.view
self.controller_list.append
self.model.body_name2id
Grasping_Agent_multidiscrete.Grasp_Agent.epsilon_greedy
numpy.std
self.controller.move_ee
agent.transform_observation.to
self.UP1
self.optimizer.step
end_idx.start_idx.batch.state.torch.cat.to
self.C1.view
torch.utils.data.DataLoader
states.append
torch.cuda.is_available
inspect.signature.bind_partial
self.model.body_id2name
self.memory.sample
numpy.reshape
cv2.imshow
simple_Transition
self.model.joint_id2name
print
self.normal_rgb
max_idx.unsqueeze_.cpu
sys.path.append
self.controller.ik
self.controller.open_gripper
targets.size
matplotlib.pyplot.figure
self.controller.grasp
self.writer.add_histogram
positive_threshold.predictions.int
random.seed
tqdm.tqdm
self.bn1
bound_values.arguments.items
AverageMeter.reset
random.sample.append
time.localtime
NotImplementedError
gym.spaces.Discrete
numpy.where
rgb.self.standardize_rgb.float
self.controller.close_gripper
Modules.MULTIDISCRETE_RESNET.to.state_dict
self.ik
self.last_100_loss.append
pathlib.Path
self.conv1
cv2.waitKey
self.conv3
self.create_camera_data
grad.view.cpu.numpy
self.reset
torch.save
observation.astype
torch.tensor
next_state_batch.self.target_net.max
self.relu
setuptools.setup
end_idx.start_idx.batch.reward.torch.cat.to.float
ljust
gym_grasper.controller.MujocoController.MJ_Controller.show_model_info
self.writer.add_graph
data.unsqueeze.to
typeassert
env.action_space.sample
time.time
self.C1.squeeze_
self.policy_net.parameters
file.read
main
enumerate
Modules.Transition
torch.utils.tensorboard.SummaryWriter
prettytable.PrettyTable.add_row
collections.namedtuple
repr
self.conv2
ikpy.chain.Chain.from_urdf_file
torch.nn.Conv2d
targets.int
torch.cuda.manual_seed
math.exp
numpy.random.seed
negative_threshold.predictions.int
negative_positions.correct_prediction_2.sum.item
self.move_and_grasp
Grasping_Agent_multidiscrete.Grasp_Agent.transform_observation
fig.add_subplot.set_xlabel
agent.env.reset
Modules.MULTIDISCRETE_RESNET.to.load_state_dict
Modules.MULTIDISCRETE_RESNET
Grasp_Agent.update_tensorboard
gym.make
self.sim.step
ee_position.copy
depth.torch.tensor.float
self.create_joint_angle_plot
self.sim.data.get_joint_qpos
pyquaternion.Quaternion
gym_grasper.controller.MujocoController.MJ_Controller
numpy.array
cv2.cvtColor
self.policy_net
MAX_POSSIBLE_SAMPLES.state_batch.self.policy_net.view.gather
torchvision.transforms.Lambda
next_state_batch.self.target_net.max.unsqueeze
self.transform_observation
torch.manual_seed
gym.make.step
self.fill_plot_list
agent.env.close
torch.nn.BatchNorm2d
self.memory.append
random.sample
numpy.mean
torch.utils.data.random_split
matplotlib.pyplot.figure.add_subplot
self.target_net.load_state_dict
max
actions.append
agent.optimizer.zero_grad
func.items
torch.nn.ReLU
fig.add_subplot.axhline
gym.make.print_info
rgb.self.normal_rgb.float
grasping_dataset.Grasping_Dataset
data.to
targets.negative_predection.int
torch.nn.functional.binary_cross_entropy
self.last_1000_actions.append
Modules.simple_Transition
Grasp_Agent
targets.correct_prediction.sum.item
gym_grasper.controller.MujocoController.MJ_Controller.stay
self.MP2
end_idx.start_idx.batch.next_state.torch.cat.to
Modules.MULTIDISCRETE_RESNET.to.parameters
self.actuators.append
self.sigmoid
self.create_lists
self.Grasping_Module.super.__init__
type
numpy.argmax
Grasp_Agent.transform_action
self.optimizer.load_state_dict
binary_accuracy
self.RB2
list
torch.cat
os.path.realpath
rgb.self.normal_rgb_no_jitter_no_noise.float
count_parameters
len
torchvision.transforms.Compose
self.MP1
time.perf_counter
mujoco_py.MjViewer
self.get_observation
data.unsqueeze.to.float
self.sim.render
random.random
numpy.zeros
eval_on_test_set
self.Perception_Module.super.__init__
mujoco_py.MjSim
numpy.expand_dims
coordinates_2.np.round.np.ndarray.coordinates_2.isinstance.ljust
torch.nn.Sigmoid
torch.nn.UpsamplingBilinear2d
inspect.signature.bind
self.set_state
self.plot_list.keys
next_state_batch.self.target_net.max.unsqueeze.detach
targets.correct_prediction.sum
Grasping_Module
AverageMeter
agent.epsilon_greedy.item
gym.make.close
torch.nn.functional.binary_cross_entropy.item
MULTIDISCRETE_RESNET
Grasp_Agent.epsilon_greedy
negative_positions.correct_prediction_2.sum
gym_grasper.controller.MujocoController.MJ_Controller.grasp
agent.memory.push
self.target_net
torch.optim.Adam.state_dict
j.self.actuators
torch.Tensor
join
cv2.destroyAllWindows
fig.add_subplot.set_title
self.RB3
Grasping_Agent_multidiscrete.Grasp_Agent.learn
gym.envs.mujoco.mujoco_env.MujocoEnv.__init__
device.state.to.self.policy_net.view.max
torch.load
numpy.random.normal
TypeError
super
state_batch.self.policy_net.view
Modules.MULTIDISCRETE_RESNET.to
self.controller.get_image_data
depth_tensor.detach.clone.unsqueeze_
grad.view
torchvision.transforms.ToPILImage
self.move_group_to_joint_target
self.groups.keys
self.model.get_joint_qpos_addr
Grasp_Agent.transform_observation
end_idx.start_idx.batch.reward.torch.cat.to
self.model.camera_id2name
torch.no_grad
functools.wraps
numpy.random.uniform
BasicBlock

@developer
Could please help me check this issue?
May I pull a request to fix it?
Thank you very much.

module 'ikpy' has no attribute 'chain'

When I run example.py, the following error is generated.I tried to lower the ikpy version to 3.1 and still got the error.

Traceback (most recent call last):
File "C:/Users/eEthan1/PycharmProjects/RL_UR5/example.py", line 4, in
controller = MJ_Controller()
File "C:\Users\eEthan1\PycharmProjects\RL_UR5\gym_grasper\controller\MujocoController.py", line 47, in init
self.ee_chain = ikpy.chain.Chain.from_urdf_file(path + "/UR5+gripper/ur5_gripper.urdf")
AttributeError: module 'ikpy' has no attribute 'chain'

Could not find an inverse kinematics solution.

Hey Paul,
I ran into a problem when I downloaded this code for the second time, saying ' x0 is infeasible. Could not find an inverse kinematics solution. '
Could you please help me?

PID controllers

Why your joint controllers have to run repetitively until reaching their setpoints? Usually, these controllers constantly run a much higher frequency in the inner loop while their setpoints are set from an outer loop which often runs at a slower rate. Therefore, the controllers do not have to reach their setpoints before the setpoints are changed. But it seems you are not following this structure.

How to use Offline_RL to train this agent?

Hi, thanks for sharing this amazing project!
I have successfully run example.py and example_agent.py. Here are two questions I currently have:

  1. It really confused me that example_agent.py seems only do multiple simulation steps instead of learning to grasp things, according to its code. I'm really new to mujoco and RL, sorry if I have missed some obvious thing here.
  2. How to use the models in Modules.py and Offline_RL to get this agent learning? In train.py it has a load_path ("../xxx.pt"), is it generated from another .py file?

Much appreciate.

`x0` is infeasible. Could not find an inverse kinematics solution.

Hi! When I run python example.py , I got this

x0 is infeasible.
Could not find an inverse kinematics solution.

And I try to change the position's value in controller.move_ee function, but it didn't work.

I use python3.6.9, mujoco2.1.0 , mujoco-py2.1.2.14 and ikpy3.3.

what does the array [0, -0.005, 0.16] mean?

I want apply MujocoController with kinova jaco2, then got trouble in open_griper(). robot run wrong.In the function move_group_to_joint_target() in MujocoController, there is temp = self.sim.data.body_xpos[self.model.body_name2id('ee_link')] - [0, -0.005, 0.16]. so i want to know what does [0, -0.005, 0.16] mean to UR5?

Did not grasp anything

Hi! Thanks for your grear work!

It seems that the gripper can not grasp anything during training. Can you tell me what's wrong with it?

Thanks!
image

Observation space

image

Encountered the following error while running the example_agent.py file, How to provide the observation space while running the script?

UR5 Controller

Thank you for sharing your project.
I want to run UR3 Reinforcement learning with Mujoco simulator.
But when I run UR3 in mujoco, It cannot solve its kinematics at all.
It's similar to controller (that ur5 controller)
How did you make ur5 controller?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.