Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct dockerfile & upgrade to nvidia-docker2 #40

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d2e0b3c
fix alias cdlf
ianchen-tw Sep 1, 2018
a2be8f9
add env settings
ianchen-tw Sep 1, 2018
943742b
change input number
ianchen-tw Sep 8, 2018
35eb7c7
expand nvidia-docker command into mult-line
ianchen-tw Sep 12, 2018
88a1d9a
seperate the install_dependcies.sh for readability
ianchen-tw Sep 15, 2018
7ec942e
successfully compiled director
ianchen-tw Sep 17, 2018
9060e19
install elastic fusion's dependencies
ianchen-tw Sep 17, 2018
a707067
compiled successfully
ianchen-tw Sep 19, 2018
a4866a2
change docker run options
ianchen-tw Sep 20, 2018
b95473c
fix dependency for ubuntu 16.04
ianchen-tw Oct 4, 2018
11b02a0
use the older version of director
ianchen-tw Oct 4, 2018
bd32cf7
add elasticfusion camera.cfg
Daichou Oct 5, 2018
f2bab16
add D435 camera parameter to render train image proccess
Daichou Oct 5, 2018
f4d1bb6
add intel realsense camera usage
Daichou Oct 5, 2018
e69be5e
Update README.rst
Daichou Oct 5, 2018
61cc999
update realsense operation guide
Daichou Oct 5, 2018
85c5981
Add camera calibration parameter doc
Daichou Oct 5, 2018
6d3a684
combine multiple RUN command and stop from sourcing other scripts
ianchen-tw Oct 5, 2018
670c801
clean up code and use the latetest docker image
ianchen-tw Oct 5, 2018
e3b2449
remove unnecessary files and add a config file
ianchen-tw Oct 5, 2018
e89d265
change the size of object to variable length
ianchen-tw Oct 6, 2018
c4d79e7
changes for pr
ianchen-tw Nov 27, 2018
6821bf3
move bugfix into another branch
ianchen-tw Nov 28, 2018
8dc1160
load custom camera.cfg if exist
ianchen-tw Dec 8, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
data/
*pyc
automation/scp_config.yaml
src/ply
src/ply
docker/director-build/*
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.12
75 changes: 75 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ This is the quick version. If you'd prefer to go step-by-step manually, see Pip

.. _Pipeline_Instructions: https://github.com/RobotLocomotion/LabelFusion/blob/master/docs/pipeline.rst

Camera intrinsic calibration
---------------------------

For ElasticFusion calibration, create camera.cfg file into your lcm-log folder. camera.cfg is :code:`fx fy px py` in one line.

For render training image, edit :code:`LabelFusion/modules/labelfusion/rendertrainingimages.py` "setCameraInstrinsicsAsus" fuction.

.. code-block:: python

def setCameraInstrinsicsAsus(view):
principalX = 320.0
principalY = 240.0
focalLength = 617.0 # fx = fy = focalLength
setCameraIntrinsics(view, principalX, principalY, focalLength)



Collect raw data from Xtion
---------------------------

Expand All @@ -44,6 +61,64 @@ In another, run:
Your data will be saved in current directory as :code:`lcmlog-*`.


Collect raw data from Realsense
---------------------------

First, install `librealsense <https://github.com/IntelRealSense/librealsense>`_
, `intel_ros_relasense <https://github.com/intel-ros/realsense>`_
and `rgbd_ros_to_lcm <https://github.com/MobileManipulation/rgbd_ros_to_lcm>`_

Second, :code:`cdlf && cd data/logs`, then make a new directory for your data. In one terminal, run:

::

roscore

In one, run:

::

roslaunch realsense2_camera rs_rgbd.launch

modify rgbd_ros_to_lcm topic:
modify this file ~/catkin_ws/src/rgbd_ros_to_lcm/launch/lcm_republisher.launch to

.. code-block::

<?xml version="1.0"?>
<launch>
<node name="lcm_republisher" pkg="rgbd_ros_to_lcm" type="lcm_republisher" output="screen" respawn="false" >
<rosparam subst_value="true">
# input parameters
subscribe_point_cloud: false
rgb_topic: /camera/color/image_raw
depth_topic: /camera/aligned_depth_to_color/image_raw
cloud_topic: /camera/depth_registered/points

# output parameters
output_lcm_channel: "OPENNI_FRAME"
compress_rgb: true
compress_depth: true

debug_print_statements: true
</rosparam>
</node>
</launch>

and run

::

roslaunch rgbd_ros_to_lcm lcm_republisher.launch

In another, run:

::

lcm-logger

Your data will be saved in current directory as :code:`lcmlog-*`.

Process into labeled training data
----------------------------------

Expand Down
89 changes: 0 additions & 89 deletions docker/compile_all.sh

This file was deleted.

7 changes: 7 additions & 0 deletions docker/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
#
# This script define the name of the labelfusion docker image.
#

#image_name=robotlocomotion/labelfusion:latest
image_name=ianre657/labelfusion:16.04-latetest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this PR, I would like to change the image name back to the official name. I can build the branch and push the new image before landing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just change it as you wish.

8 changes: 5 additions & 3 deletions docker/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
#

set -exu
source ./config.sh

root_dir=$(cd $(dirname $0)/../ && pwd)

tag_name=robotlocomotion/labelfusion:test

docker build -f $root_dir/docker/labelfusion.dockerfile -t ${tag_name} $root_dir/docker
docker build \
-f $root_dir/docker/labelfusion.dockerfile \
-t ${image_name} \
$root_dir/docker
31 changes: 19 additions & 12 deletions docker/docker_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
#
# Usage: ./docker_run.sh [/path/to/data]
#
# This script calls `nvidia-docker run` to start the labelfusion
# container with an interactive bash session. This script sets
# the required environment variables and mounts the labelfusion
# source directory as a volume in the docker container. If the
# path to a data directory is given then the data directory is
# also mounted as a volume.
# This script calls `docker` with `nvidia-docker2 runtime` to start the
# labelfusion container with an interactive bash session. This script
# sets the required environment variables and mounts the labelfusion
# source directory as a volume in the docker container. If the path
# to a data directory is given then the data directory is also mounted
# as a volume.
#

image_name=robotlocomotion/labelfusion:latest


source ./config.sh
source_dir=$(cd $(dirname $0)/.. && pwd)

if [ ! -z "$1" ]; then
Expand All @@ -26,6 +24,15 @@ if [ ! -z "$1" ]; then
data_mount_arg="-v $data_dir:/root/labelfusion/data"
fi

xhost +local:root;
nvidia-docker run -it -e DISPLAY -e QT_X11_NO_MITSHM=1 -v /tmp/.X11-unix:/tmp/.X11-unix:rw -v $source_dir:/root/labelfusion $data_mount_arg --privileged -v /dev/bus/usb:/dev/bus/usb $image_name
xhost -local:root;
xhost +
docker run -it \
--rm \
--runtime=nvidia \
-e DISPLAY \
--privileged \
-e QT_X11_NO_MITSHM=1 \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-v $source_dir:/root/labelfusion $data_mount_arg \
-v /dev/bus/usb:/dev/bus/usb \
$image_name
xhost -
45 changes: 0 additions & 45 deletions docker/install_dependencies.sh

This file was deleted.

Loading