mirror of
https://github.com/wassname/kair_algorithms_draft.git
synced 2026-09-10 12:14:41 +08:00
Modify docker related commands (#54)
* Add new ros package installation(orocos, hrl-kdl) * Add source bashrc * update train script * Add custom package ros * Change delegating env_name logic * Add reacher env when training selection * Change clone branch to master
This commit is contained in:
committed by
Seungjae Ryan Lee
parent
5ff59a280e
commit
4b56ae781b
+4
-2
@@ -13,7 +13,7 @@ RUN apt-get update -y && apt-get upgrade -y
|
||||
RUN apt-get install -y ros-${ROS_DISTRO}-desktop-full ros-${ROS_DISTRO}-rqt-*
|
||||
RUN rosdep init && rosdep update
|
||||
RUN apt install -y python-rosinstall python-rosinstall-generator python-wstool build-essential
|
||||
RUN apt-get install -y ros-${ROS_DISTRO}-ros-controllers ros-${ROS_DISTRO}-gazebo* ros-${ROS_DISTRO}-moveit* ros-${ROS_DISTRO}-industrial-core
|
||||
RUN apt-get install -y ros-${ROS_DISTRO}-ros-controllers ros-${ROS_DISTRO}-gazebo* ros-${ROS_DISTRO}-moveit* ros-${ROS_DISTRO}-industrial-core ros-${ROS_DISTRO}-orocos-*
|
||||
RUN rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# ROS setting
|
||||
@@ -35,13 +35,14 @@ RUN cd src/ && \
|
||||
git clone -b ${ROS_DISTRO}-devel https://github.com/kairproject/open_manipulator_msgs.git && \
|
||||
git clone -b ${ROS_DISTRO}-devel https://github.com/kairproject/open_manipulator_simulations.git && \
|
||||
git clone -b ${ROS_DISTRO}-devel https://github.com/kairproject/robotis_manipulator.git && \
|
||||
git clone https://github.com/gt-ros-pkg/hrl-kdl.git && \
|
||||
git clone https://github.com/kairproject/kair_algorithms_draft.git
|
||||
|
||||
RUN cd src/DynamixelSDK/python && python setup.py install
|
||||
|
||||
# install pip
|
||||
RUN wget https://bootstrap.pypa.io/get-pip.py
|
||||
RUN python2.7 get-pip.py
|
||||
RUN python2.7 get-pip.py && rm get-pip.py
|
||||
|
||||
# gym requirements
|
||||
RUN apt-get update && apt-get install -y python3-opengl zlib1g-dev libjpeg-dev patchelf \
|
||||
@@ -49,6 +50,7 @@ RUN apt-get update && apt-get install -y python3-opengl zlib1g-dev libjpeg-dev p
|
||||
|
||||
# install repository requirements
|
||||
RUN apt-get remove -y python-psutil
|
||||
|
||||
RUN cd src/kair_algorithms_draft/scripts && python2.7 -m pip install -r requirements.txt
|
||||
RUN python2.7 -m pip install gym['Box2d']
|
||||
|
||||
|
||||
+10
-2
@@ -4,12 +4,20 @@ ROS_DISTRO=kinetic
|
||||
CATKIN_WS=/root/catkin_ws
|
||||
KAIR=$CATKIN_WS/src/kair_algorithms_draft
|
||||
|
||||
source /opt/ros/$ROS_DISTRO/setup.bash
|
||||
source $CATKIN_WS/devel/setup.bash
|
||||
|
||||
if [ "$1" == "lunarlander" ]; then
|
||||
cd $KAIR/scripts; \
|
||||
python run_lunarlander_continuous.py --algo $2 --off-render
|
||||
elif [ "$1" == "openmanipulator" ]; then
|
||||
elif [ "$1" == "reacher" ]; then
|
||||
cd $KAIR/scripts; \
|
||||
/opt/ros/$ROS_DISTRO/bin/rosrun kair_algorithms run_open_manipulator_reacher_v0.py --algo $2 --off-render
|
||||
python run_reacher_v1.py --algo $2 --off-render
|
||||
elif [ "$1" == "openmanipulator" ]; then
|
||||
cd $CATKIN_WS; \
|
||||
roslaunch kair_algorithms open_manipulator_env.launch gui:=false &
|
||||
cd $KAIR/scripts; \
|
||||
rosrun kair_algorithms run_open_manipulator_reacher_v0.py --algo $2 --off-render
|
||||
else
|
||||
echo "Unknown parameter"
|
||||
fi
|
||||
|
||||
@@ -44,7 +44,10 @@ class AbstractAgent(object):
|
||||
self.args.max_episode_steps = env._max_episode_steps
|
||||
|
||||
# for logging
|
||||
self.env_name = str(self.env.env).split("<")[1].replace(">>", "")
|
||||
if hasattr(env, "env_name"):
|
||||
self.env_name = env.env_name
|
||||
else:
|
||||
self.env_name = self.env.unwrapped.spec.id
|
||||
self.sha = (
|
||||
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])[:-1]
|
||||
.decode("ascii")
|
||||
|
||||
Reference in New Issue
Block a user