fix errors in setup and bullet_ros

This commit is contained in:
Brian Delhaisse
2019-07-02 20:11:24 +02:00
parent 0755d6dac7
commit 0a482b409c
6 changed files with 13 additions and 63 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ class Laikago(QuadrupedRobot):
def get_home_joint_positions(self):
"""Return the joint positions for the home position"""
return np.zeros(self.num_dofs)
return np.zeros(self.num_actuated_joints)
# Test
+2 -2
View File
@@ -3298,9 +3298,9 @@ class Bullet(Simulator):
def calculate_jacobian(self, body_id, link_id, local_position, q, dq, des_ddq):
r"""
Return the full geometric Jacobian matrix :math:`J(q) = [J_{lin}(q), J_{ang}(q)]^T`, such that:
Return the full geometric Jacobian matrix :math:`J(q) = [J_{lin}(q)^T, J_{ang}(q)^T]^T`, such that:
.. math:: v = [\dot{p}, \omega]^T = J(q) \dot{q}
.. math:: v = [\dot{p}^T, \omega^T]^T = J(q) \dot{q}
where :math:`\dot{p}` is the Cartesian linear velocity of the link, and :math:`\omega` is its angular velocity.
+2 -1
View File
@@ -192,7 +192,7 @@ class BulletROS(Bullet): # , ROS):
# check if valid robot directory
# if os.path.isdir(path):
robot_path = '/'.join(path.split('/')[-5:-2])
robot_path = '/'.join(path.split('/')[-4:-1])
if robot_path == 'pyrobolearn/robots/urdfs':
# get corresponding subscriber/publisher
@@ -213,6 +213,7 @@ class BulletROS(Bullet): # , ROS):
module = importlib.import_module('pyrobolearn.robots.ros.' + name)
classes = dict(inspect.getmembers(module, inspect.isclass))
cls = classes['Robot' + name.capitalize()]
print("class: ".format(cls))
dictionary[id_] = cls(name=robot_directory_name, id_=id_)
# load subscriber in simulator
-54
View File
@@ -1,54 +0,0 @@
#!/usr/bin/env python
"""ROS-RBDL simulator
This 'simulator' is not per se a simulator, it communicates with the real robots in the real world using ROS [1], and
computes any necessary kinematic and dynamics information using the RBDL library [2].
Specifically, this 'simulator' starts the `roscore` (if not already running), then loads robot urdf models and creates
the necessary topics/services, and uses the rigid body dynamics library to compute kinematic and dynamic information
about the model.
Dependencies in PRL:
* `pyrobolearn.simulators.simulator.Simulator`
References:
[1] ROS: http://www.ros.org/
[2] RBDL: https://rbdl.bitbucket.io/
"""
# TODO
import rospy
import rbdl
from pyrobolearn.simulators.simulator import Simulator
__author__ = "Brian Delhaisse"
__copyright__ = "Copyright 2018, PyRoboLearn"
__credits__ = ["Brian Delhaisse"]
__license__ = "GNU GPLv3"
__version__ = "1.0.0"
__maintainer__ = "Brian Delhaisse"
__email__ = "briandelhaisse@gmail.com"
__status__ = "Development"
class ROS_RBDL(Simulator):
r"""ROS-RBDL Interface.
References:
[1] ROS: http://www.ros.org/
[2] RBDL: https://rbdl.bitbucket.io/
[3] RBDL in Python: https://rbdl.bitbucket.io/dd/dee/_python_example.html
"""
def __init__(self):
super(ROS_RBDL, self).__init__()
def step(self):
"""Perform a step in the simulator."""
pass
def load_urdf(self, filename, position, orientation):
# load the model in rbdl
model = rbdl.loadModel(filename)
+7 -4
View File
@@ -1,9 +1,12 @@
# To only install dependencies, type:
# $ pip install -r requirements.txt
psutil>=5.6.3
# cython
# skbuild
# numpy>=1.13.3
numba>=0.42.0
# pyquaternion
numpy-quaternion
autograd>=1.2
matplotlib>=2.0.2
@@ -20,9 +23,10 @@ torch>=1.0.0
torchvision>=0.2.1
# simulators
psutils
pybullet>=2.4.1
gym>=0.10.9
# git+git://github.com/benelot/pybullet-gym
# -e git+https://github.com/benelot/pybullet-gym#egg=pybullet-gym
# interfaces
inputs>=0.5
@@ -33,8 +37,7 @@ gTTS>=2.0.3
# models and algos
sklearn>=0.0
# gpytorch>=0.1.0rc4
# git+git://github.com/cornellius-gp/gpytorch/archive/alpha.zip
# http://github.com/cornellius-gp/gpytorch/archive/alpha.zip
# -e git+https://github.com/cornellius-gp/gpytorch/archive/alpha.zip#egg=gpytorch
GPy>=1.9.6
GPyOpt>=1.2.5
# hmmlearn>=0.2.1
@@ -63,4 +66,4 @@ slycot>=0.3.3
# worlds/utils
# gdal>=1.11.3
# need to install rbdl, ipopt, tf
# need to install rbdl, ipopt, tf
+1 -1
View File
@@ -11,7 +11,7 @@ except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
# get description from readme file
with open('README.md', 'r') as f:
with open('README.rst', 'r') as f:
long_description = f.read()
# get the required packages