Unverified Commit d72fbd9f authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #1 from nim65s/master

Minor updates
parents 8640f962 0ebab861
Pipeline #539 failed with stages
in 16 seconds
variables:
GIT_SSL_NO_VERIFY: "true"
stages:
- build
- deploy
build:
stage: build
image: eur0c.laas.fr:4567/stack-of-tasks/pinocchio-tutorials/build
script: cmake . && make
artifacts:
paths:
- html
expire_in: 1 week
deploy:
stage: deploy
image: eur0c.laas.fr:4567/stack-of-tasks/pinocchio-tutorials/deploy
before_script:
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
script: "scp -r html/* gitlab@iwaki.laas.fr:/var/www/html/"
environment:
name: iwaki
url: http://iwaki.laas.fr
......@@ -3,7 +3,9 @@ PROJECT(pinocchio_tutos)
FIND_PROGRAM(ASCIIDOC NAMES asciidoc)
set(ASCIIDOC ${ASCIIDOC} --filter latex -a toc -a icons -o)
FIND_PROGRAM(ZIP NAMES zip)
#set(ZIP "${ZIP} -j")
MESSAGE(STATUS ZIP "--${ZIP}--")
# --- ASCIIDOC RULES ---------------------------------------------------------------
MACRO(ADD_ASCIIDOC_TARGET asciidocfile htmlfile)
# Create a "CUSTOM_COMMAND" to create the htmlfile from the asciidoc file.
......@@ -126,6 +128,7 @@ foreach(dirname ${dirtargets})
)
endforeach(secname)
# --- Add python files
set(pydeps)
foreach(pyname ${${dirname}_pythons})
get_filename_component(basename ${pyname} NAME_WE)
get_filename_component(extname ${pyname} EXT)
......@@ -139,11 +142,20 @@ foreach(dirname ${dirtargets})
DEPENDS ${CMAKE_SOURCE_DIR}/${${dirname}_dir}/${pyname}
COMMENT "Copy ${pyname}")
LIST(APPEND dirdeps ${destpy}/${dirname}/${pyname})
LIST(APPEND pydeps ${destpy}/${dirname}/${pyname})
asciidoc_from_python_target(${destpy}/${dirname}/${pyname} ${shortname}.asciidoc )
add_asciidoc_target(${shortname}.asciidoc ${dest}/${shortname}.html)
LIST(APPEND dirdeps ${dest}/${shortname}.html)
endforeach(pyname)
# Add rule tpXX_ to compile all the directory.
if(${dirname}_pythons)
add_custom_command(
OUTPUT ${dest}/${dirname}.zip
COMMAND ${ZIP} -rj ${dest}/${dirname}.zip ${destpy}/${dirname}/
DEPENDS ${dirdeps}
COMMENT "Zip rule for ${dest}/${dirname}.zip ${ZIP} ${dest}/${dirname}.zip ${destpy}/${dirname}/")
LIST(APPEND dirdeps ${dest}/${dirname}.zip)
endif()
add_custom_target(${dirname}_ DEPENDS ${dirdeps})
LIST(APPEND alldeps ${dirname}_)
endforeach(dirname)
......
FROM ubuntu:16.04
RUN apt-get update -qqy && apt-get install -qqy \
asciidoc \
cmake \
g++ \
source-highlight \
&& rm -rf /var/lib/apt/lists/*
FROM ubuntu:16.04
RUN apt-get update -qqy && apt-get install -qqy \
openssh-client \
&& rm -rf /var/lib/apt/lists/*
#!/bin/bash
NAME=eur0c.laas.fr:4567/stack-of-tasks/pinocchio-tutorials
for stage in build deploy
do (
docker build -t $NAME/$stage -f Dockerfile.$stage .
docker push $NAME/$stage
) &
done
wait
#! /bin/sh
### Install basic dependencies
sudo apt-get install -y cmake cmake-curses-gui cmake-qt-gui curl doxygen g++ ipython libassimp-dev assimp-utils libboost-dev omniidl-python omniorb omniorb-idl omniorb-nameserver libomniorb4-dev libomnithread3-dev python python-matplotlib python-numpy python-scipy python2.7 qgit libbz2-dev zlib1g-dev libssl-dev pax tar libeigen3-dev libtinyxml-dev liburdfdom-dev libboost-all-dev libpcre3-dev libopenscenegraph-dev libqt4-dev python-qt4-dev libncurses-dev python-pip cython python-h5py
### Setup environment
echo 'export ROBOTPKG_BASE=/opt/openrobots' >> .bashrc
echo 'export PKG_CONFIG_PATH=$ROBOTPKG_BASE/lib/pkgconfig:${PKG_CONFIG_PATH}' >> .bashrc
echo 'export LD_LIBRARY_PATH=$ROBOTPKG_BASE/lib/:$ROBOTPKG_BASE/lib64/:${LD_LIBRARY_PATH}' >> .bashrc
......@@ -20,7 +19,7 @@ curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key
sudo apt-get update
### Install Pinocchio
sudo apt-get install -y robotpkg-pinocchio robotpkg-osg-dae robotpkg-gepetto-viewer-corba
sudo apt-get install -y robotpkg-pinocchio robotpkg-osg-dae robotpkg-gepetto-viewer-corba robotpkg-omniorbpy
### Install other requirement (quadprog, tensorflow)
sudo chmod -R a+w /usr/local/
......@@ -28,5 +27,3 @@ sudo pip install quadprog
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.4.0-cp27-none-linux_x86_64.whl
pip install --upgrade $TF_BINARY_URL
pip install tflearn
......@@ -18,26 +18,18 @@ The tutorial is performed inside a virtual machine, under VirtualBox. VirtualBox
* Start the virtual machine. The system auto log on the main user (ID student, password student). This user owns sudoer privilege.
* [optional] A complete tutorial about VirtualBox, along with an explanation of what is virtualization, is available here
* [optional] A Md5 checksum for each image is available here. This file can be used that the .ova file has been properly downloaded. Under Linux, check by first downloading both files .ova and .md5 in the same directory and then typing md5sum -c u1404x32.md5.
* [optional] You can install the "Guest Additions" in your virtual box, to improve the performance of the virtual computer (e.g. enlarge the size of the display). In the VirtualBox menu (when the virtual machine is on), choose "Devices" [Périphérique], then "Insert Guest Additions" [Additions Invités], and follow the instructions (remember that the password is "student").
* [optional] You can install the "Guest Additions" in your virtual box, to improve the performance of the virtual computer (e.g. enlarge the size of the display). In the VirtualBox menu (when the virtual machine is on), choose "Devices" [Périphérique], then "Insert Guest Additions" [Additions Invités], and follow the instructions (remember that the password is "student").
ii) Installation on the native Ubuntu system
--------------------------------------------
You can alternatively install the software on a native Linux. The instructions are the same for Ubuntu 12.04, 14.04 (32 or 64bits). It should work for a Ubuntu 16.04 (except osg-dae that is not working).
You can alternatively install the software on a native Linux. The instructions are the same for Ubuntu 12.04, 14.04 (32 or 64bits) and 16.04 (64bits).
The link:tp0_install_sh.html[script here] collects all the instructions that were needed to set up the above Virtual Box. It should run immediately on U14.04x64.
On Ubuntu 14.04, the following distrib packages are needed (similar in u16.04, just adapt some of the names with simple google searches):
[source,python]
----
apt-get install cmake cmake-curses-gui cmake-qt-gui curl doxygen g++ ipython libassimp-dev assimp-utils libboost-dev omniidl-python omniorb omniorb-idl omniorb-nameserver libomniorb4-dev libomnithread3-dev python python-matplotlib python-numpy python-scipy python2.7 qgit libbz2-dev zlib1g-dev libssl-dev pax tar libeigen3-dev libtinyxml-dev liburdfdom-dev libboost-all-dev libpcre3-dev libopenscenegraph-dev libqt4-dev python-qt4-dev libncurses-dev python-pip cython python-h5py
----
Then
The Debian (APT) packages are build from a packaging "from sources" system named robot-pkg.
Debian packets have been tested on U14.04 and U16.04. They should run out of the box (osg-dae only works on U14.04 but may be skipped). Set up the repository of robot-pkg:
[source,python]
The Debian (APT) packages are build from a packaging "from sources" system named robot-pkg.
Debian packets have been tested on U14.04 and U16.04. They should run out of the box. Set up the repository of robot-pkg:
[source,bash]
----
relcode=`lsb_release -cs`
sudo tee /etc/apt/sources.list.d/robotpkg.list <<EOF
......@@ -64,10 +56,11 @@ export PYTHONPATH=${PYTHONPATH}:${ROBOTPKG_BASE}/${PYTHON_LOCAL_PATH}:${ROBOTPKG
Finally instal the following APT packages
[source,python]
----
apt-get install -y robotpkg-pinocchio robotpkg-osg-dae robotpkg-gepetto-viewer-corba
sudo apt-get install -y robotpkg-pinocchio robotpkg-osg-dae robotpkg-gepetto-viewer-corba robotpkg-omniorbpy
----
The installation can be tested by running link:tp0_viewer_unittest_py.html[this Python script].
In case you prefer to install from source, robot-Pkg is available link:http://robotpkg.openrobots.org/install.html[at this URL]. Follow the instructions to set up robot-pkg and robot-pkg wip:
ALTERNATIVELY (don't do that if you already manage to install the packages through APT), you may you prefer to install from source, robot-Pkg is available link:http://robotpkg.openrobots.org/install.html[at this URL]. Follow the instructions to set up robot-pkg and robot-pkg wip:
[source,python]
----
git clone git://git.openrobots.org/robots/robotpkg
......@@ -77,6 +70,3 @@ git clone git://git.openrobots.org/robots/robotpkg/robotpkg-wip wip
(see also the dedicated menu to robot-pkg wip).
Once robot-pkg is set up, install the packages wip/pinocchio (make checkout before make install), wip/osg-dae, and graphics/gepetto-viewer-corba/ .
The installation can be tested by running link:tp0_viewer_unittest_py.html[this Python script].
On u16.04, the plugin Osg-dae is not going to install properly. As most of the URDF files are using DAE mesh files, gepetto-viewer will not be able to properly display your models (note that Pinocchio will work properly, only display will fail). You then have two solutions: - re-compile OSG from source, which should also install the OSG DAE plugin. This is 2 hours of compilation, but should work fine. - In your URDF model, duplicate your mesh files to have both DAE file and OSG file (using osgconv). Then patch robot_wrapper.py to have gepetto-viewer loading the OSG files instead of DAE files (do not modify the URDF file): replace line #184 by "self.viewer.gui.addMesh(meshName, meshPath[:-3]+'osg')"
\ No newline at end of file
......@@ -136,11 +136,11 @@ pkg = '/home/student/models/'
urdf = pkg + '/ur_description/urdf/ur5_gripper.urdf'
robot = RobotWrapper(urdf,[pkg,])
----
The code of the RobotWrapper class is in /path/to/pinocchio//src/python/romeo_wrapper.py . Do not hesitate to have a look at it and to take inspiration from the implementation of the class functions.
The code of the RobotWrapper class is in /opt/openrobots/lib/python2.7/site-packages/pinocchio/robot_wrapper.py . Do not hesitate to have a look at it and to take inspiration from the implementation of the class functions.
UR5 is a fixed robot with one 6-DOF arms developed by the Danish company Universal Robot. All its 6 joints are revolute joints. Its configuration is in R^6 and is not subject to any constraint. The model of UR5 is described in a URDF file, with the visuals of the bodies of the robot being described as meshed (i.e. polygon soups) using the Collada format ".dae". Both the URDF and the DAE files are available in the attached ZIP archive. Uncompressed it in the VirtualBox, for example in the directory "/home/student/src/pinocchio/models".
UR5 is a fixed robot with one 6-DOF arms developed by the Danish company Universal Robot. All its 6 joints are revolute joints. Its configuration is in R^6 and is not subject to any constraint. The model of UR5 is described in a URDF file, with the visuals of the bodies of the robot being described as meshed (i.e. polygon soups) using the Collada format ".dae". Both the URDF and the DAE files are available in the attached ZIP archive. Uncompressed it in the VirtualBox, for example in the directory "/home/student/models".
* UR5 model and code link:ur5.zip[*ur5.zip*]
* UR5 model and code link:http://homepages.laas.fr/nmansard/teach/supaero2017/ur5.zip[*ur5.zip*]
Exploring the model
~~~~~~~~~~~~~~~~~~~
......@@ -263,6 +263,11 @@ Pick:
~~~~~
Say we have a target at position [.5,.1,.2] and we would like the robot to grasp it.
[source,python]
----
robot.viewer.gui.applyConfiguration("world/sphere",[.5,.1,.2, 1.,0.,0.,0.])
robot.viewer.gui.refresh() # Refresh the window.
----
First display a small sphere at this position to visualize it.
......
......@@ -42,7 +42,7 @@ class CallbackLogger:
def __init__(self):
self.nfeval = 1
def __call__(self,x):
print '===CBK=== {0:4d} {1: 3.6f} {2: 3.6f}'.format(self.nfeval, x[0], x[1], cost(x))
print '===CBK=== {0:4d} {1: 3.6f} {2: 3.6f} {3: 3.6f}'.format(self.nfeval, x[0], x[1], cost(x))
self.nfeval += 1
x0 = np.array([0.0,0.0])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment