Giter VIP home page Giter VIP logo

pydrake_kuka's Introduction

Pydrake Kuka Sandbox and Utilities

Build Status

HOW TO RUN WITH DOCKER

  1. Run python docker_build.py. This builds a Docker image named pydrake_kuka, built against (by default) the latest Drake binaries.
  2. Run python docker_run.py. This runs the above Docker image, giving you a terminal inside of the Docker container from which you can use the code. The contents of this repo are available in the directory /pydrake_kuka, and it's kept in sync with the files on the host computer, so feel free to tweak things in a text editor outside of the container. Things you can try:
  • Run cd /pydrake_kuka && ./run_tests.sh, and point a browser to <127.0.0.1:7000/static/> to watch the robot go through an automated cutting test.
  • Break the terminal into multiple prompts with your favorite terminal multiplexer (e.g. screen, tmux), run meshcat-server in one (and then go to its specified URL to see the visualization), and run python /pydrake_kuka/kuka_cutting_sim.py -N 2 -T 5. to run the cutting sim yourself.

To run the Kuka simulation, first run meshcat-server in a new terminal. It should report a web-url -- something like 127.0.0.1:7000/static/. Open that in a browser -- this is your 3D viewer. Then run python kuka_pydrake_sim.py and you should see the arm spawn in the viewer before doing some movements.

pydrake_kuka's People

Contributors

gizatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pydrake_kuka's Issues

Question about URDF

I am playing around with the kuka iiwa simulation and just swapping a UR10 urdf for the kuka-iiwa urdf. I currently have the following code.

tree = RigidBodyTree(FindResource("UR/urdf/ur10_robot.urdf"))

Assemble IK constraints

iiwa_urdf_path = os.path.join(pydrake.getDrakePath(), "manipulation", "models", "iiwa_description", "urdf", "iiwa14_polytope_collision.urdf")
UR_urdf_path = FindResource("UR/urdf/ur10_robot.urdf")

rbt = RigidBodyTree()
table_top_z_in_world = 0.736 + 0.057 / 2
robot_base_frame = RigidBodyFrame("robot_base_frame", rbt.world(), [0.0, 0, table_top_z_in_world], [0, 0, 0])
AddModelInstanceFromUrdfFile(UR_urdf_path, FloatingBaseType.kFixed, robot_base_frame, rbt)

print iiwa_urdf_path
print UR_urdf_path

Whenever I use the UR urdf path, I get the following error:

RuntimeError: Error parsing file "/home/me/underactuated/src/UR/urdf/./meshes/ur10/collision/base.stl.obj" : WARN: Material file [ /home/me/src/UR/urdf/./meshes/ur10/collision/base.stl.obj.mtl ] not found.
WARN: Failed to load material file(s). Use default material.

Do you know more about this?

Question about output from InverseKinTraj

When I compute the inverse kinematics of a trajectory from Point A to Point B using the following command:
results = ik.InverseKinTraj(tree, ts, q_seed, q_nom, constraints, options)

I can access the results using results.info[0].

I assume if results.info[0] returns 1, then the IK was feasible and if it returns a value other than 1, then the IK was not feasible. Is this a correct assumption?

In addition, for the full trajectory, results.info[0] only returns one value. I would have though that it would return an array of values where each result corresponds to a single knot point in the IK trajectory. Since it only return one value, what point does that correspond to? Is it the final point in the IK trajectory? Or does a value other than 1 mean that one of the points was infeasible in the entire trajectory and a returned value of 1 means that ALL of the points in the trajectory are feasible?

Visualizing the kuka_iiwa

Once you have the q_traj vector from computing the IK, is there a straightforward way to pass that into the meshcat visualizer to visualize the trajectory? I am trying to understand what aspects of the kuka_sim file are needed for visualizing the trajectory.

Questions about Rigid Body Tree, MinDistanceConstraint and IK

I currently have a function that computes q trajectory of a robot arm from point A to point B where point A and B are very close in space. For my constraints matrix, I have a WorldPositionConstraint and a WorldEulerConstraint. Whenever I add a MinDistanceConstraint:

constraints.append(ik.MinDistanceConstraint(tree, collision_tol, id_collision_body, set()))

where id_collision_body is the collision index of all the bodies in the rigid body tree and collision tol is a very small number (ie 0.0001), I get the following warning when I run the script:

[2018-11-13 18:06:07.338] [console] [warning] Attempting to compute distance between two collision elements, at least one of which is non-convex.
[2018-11-13 18:06:07.338] [console] [warning] Attempting to compute distance between two collision elements, at least one of which is non-convex.
[2018-11-13 18:06:07.342] [console] [warning] Attempting to compute distance between two collision elements, at least one of which is non-convex.

then whenever I output result.info[0] of my ik script, I get a number not equal to 0. (I am guessing 1 means there was an IK solution and a number that is not equal to 1 means there is no IK solution for the given point).

However, when I visibly look at the UR in meshcat, it seems to be a doable position. Would you have any information on this?

When I take out MinDistanceConstraint, I don't get this problem and the result.info[0] is equal to 1.

meshcat-server not working

Whenever I run meshcat-server, and navigate to the url, I get an error 404: not sound in the url and these errors:
WARNING:tornado.access:404 GET /static/ (127.0.0.1) 1.24ms
WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 0.32ms
WARNING:tornado.access:404 GET /static/ (127.0.0.1) 0.65ms
WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 0.34ms
in my terminal. Any advice ?

ipykernel no longer supports python 2

Collecting ipykernel (from jupyter)
  Downloading https://files.pythonhosted.org/packages/11/0b/95330660f8cc5d63428b9886c800ea8d68842fd866389cf579acca4915be/ipykernel-5.1.0.tar.gz (101kB)
    Complete output from command python setup.py egg_info:
    ERROR: ipykernel requires Python version 3.4 or above.
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fJaJGw/ipykernel/
You are using pip version 8.1.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The command '/bin/sh -c pip install --upgrade pip jupyter graphviz meshcat numpy trimesh pyglet' returned a non-zero code: 1

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.