Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
132 changes: 132 additions & 0 deletions DockerFiles/ROS1.0/ROS1.0.df
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
FROM ros:melodic-robot-bionic as base

MAINTAINER Sunny <gsunny4178@gmail.com>

# This Dockerfile is modified from https://github.com/fcwu/docker-ubuntu-vnc-desktop

ENV ROS_DISTRO melodic

# Install essential packages
RUN apt update && \
DEBIAN_FRONTEND=noninteractive \
apt install --no-install-recommends -y \
vim \
nano \
tmux \
curl \
apache2-utils \
locales \
build-essential \
wget \
net-tools \
unzip \
git \
sudo \
xz-utils \
gpg-agent \
supervisor \
software-properties-common && \
rm -rf /var/lib/apt/lists/*

RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
RUN locale-gen

# Install x11vnc and relatives
RUN apt update && \
DEBIAN_FRONTEND=noninteractive \
apt install --no-install-recommends -y \
zenity \
dbus-x11 \
x11-utils \
alsa-utils \
mesa-utils \
libgl1-mesa-dri \
xvfb \
x11vnc && \
rm -rf /var/lib/apt/lists/*

# Install the GUI
RUN apt update && \
DEBIAN_FRONTEND=noninteractive \
apt install --no-install-recommends -y \
lxde \
gtk2-engines-murrine \
gnome-themes-standard \
gtk2-engines-pixbuf \
gtk2-engines-murrine \
arc-theme && \
rm -rf /var/lib/apt/lists/*

# Kill the bell!
RUN echo "set bell-style none" >> /etc/inputrc

# Install some applications
RUN apt update -y && \
DEBIAN_FRONTEND=noninteractive \
apt install --no-install-recommends -y \
ttf-ubuntu-font-family \
firefox && \
rm -rf /var/lib/apt/lists/*

# sublime
RUN apt update -y && \
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | apt-key add - && \
apt-add-repository "deb https://download.sublimetext.com/ apt/stable/" && \
DEBIAN_FRONTEND=noninteractive \
sudo apt install -y sublime-text && \
rm -rf /var/lib/apt/lists/*

# Install tini as init
ARG TINI_VERSION=v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini
RUN chmod +x /bin/tini

FROM base as robot

# Install the ros packages
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
ros-${ROS_DISTRO}-tf2-geometry-msgs \
ros-${ROS_DISTRO}-ackermann-msgs \
ros-${ROS_DISTRO}-teleop-twist-keyboard \
ros-${ROS_DISTRO}-map-server \
ros-${ROS_DISTRO}-navigation \
ros-${ROS_DISTRO}-robot-localization \
ros-${ROS_DISTRO}-cv-bridge \
ros-${ROS_DISTRO}-image-transport \
ros-${ROS_DISTRO}-tf \
ros-${ROS_DISTRO}-diagnostic-updater \
ros-${ROS_DISTRO}-desktop-full \
ros-${ROS_DISTRO}-ddynamic-reconfigure && \
rm -rf /var/lib/apt/lists/*

# Setup chickenbot_ws
RUN mkdir /chickenbot_ws && \
cd /chickenbot_ws

# Setup catkin_ws
COPY catkin_ws /catkin_ws/
RUN /bin/bash -c 'source /opt/ros/$ROS_DISTRO/setup.bash; cd /catkin_ws; catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release'

# locale and user
RUN locale-gen en_US.UTF-8 && \
ln -fs /usr/share/zoneinfo/Asia/Taipei /etc/localtime && \
dpkg-reconfigure --frontend noninteractive tzdata && \
useradd -ms /bin/bash ubuntu && \
adduser ubuntu sudo && \
chown -R ubuntu:ubuntu /home/ubuntu/

COPY ./etc/ /etc/
COPY ./bin/xvfb.sh /usr/local/bin/xvfb.sh
COPY ./bin/.gtkrc-2.0 /home/ubuntu/

RUN chmod +x /usr/local/bin/xvfb.sh

ENV HOME /home/ubuntu
WORKDIR "/home/ubuntu"

CMD ["bash", "/home/ubuntu/.startup.sh"]

# Expose the VNC port
EXPOSE 5900
20 changes: 20 additions & 0 deletions DockerFiles/ROS1.0/bin/.gtkrc-2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# DO NOT EDIT! This file will be overwritten by LXAppearance.
# Any customization should be done in ~/.gtkrc-2.0.mine instead.
include "/usr/share/themes/Arc/gtk-2.0/gtkrc"

gtk-theme-name="Arc"
gtk-icon-theme-name="nuoveXT2"
gtk-font-name="Sans 10"
gtk-cursor-theme-name="DMZ-White"
gtk-cursor-theme-size=18
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight"
gtk-xft-rgba="rgb"
include "/root/.gtkrc-2.0.mine"
3 changes: 3 additions & 0 deletions DockerFiles/ROS1.0/bin/xvfb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

exec /usr/bin/Xvfb :1 -screen 0 1600x900x24
4 changes: 4 additions & 0 deletions DockerFiles/ROS1.0/catkin_ws/src/chickenbot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 2.8.3)
project(chickenbot)
find_package(catkin REQUIRED)
catkin_metapackage()
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
obstacle_range: 4.0
raytrace_range: 4.0
footprint: [[-0.25, -0.15], [-0.25, 0.15], [0.25, 0.15], [0.25, -0.15]]
#robot_radius: 0.25
inflation_radius: 0.3

inf_is_valid: true

observation_sources: laser_scan_sensor

laser_scan_sensor: {sensor_frame: laser_link, data_type: LaserScan, topic: scan, marking: true, clearing: true}


plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}

obstacle_layer:
observation_sources: base_scan
base_scan: {data_type: LaserScan, sensor_frame: /laser_link, clearing: true, marking: true, topic: /scan}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
DWAPlannerROS:
xy_goal_tolerance: 0.12
yaw_goal_tolerance: 0.1

path_distance_bias: 100.0
goal_distance_bias: 24.0
occdist_scale: 0.01
forward_point_distance: 0.2
publish_cost_grid_pc: true
publish_traj_pc: true

max_trans_vel: 2.0
min_trans_vel: 0.01
max_vel_x: 2.0
min_vel_x: -2.0
max_vel_y: 0.0
min_vel_y: 0.0
max_rot_vel: 2.0
min_rot_vel: 0.01
acc_lim_x: 2.0
acc_lim_y: 0.0
acc_lim_theta: 2.5
acc_limit_trans: 5.0
sim_time: 1.5
sim_granularity: 0.05
global_frame_id: "map"
vx_samples: 10
vy_samples: 1
vth_samples: 10
oscillation_reset_angle: 0.01
valid_trajectory_ratio: 0.0
max_opposite_angle: 2.35619445

cheat_factor: 25.0
latch_xy_goal_tolerance: true

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
global_costmap:
global_frame: map
robot_base_frame: base_link
update_frequency: 1
static_map: true
resolution: 0.05
transform_tolerance: 2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local_costmap:
global_frame: map
robot_base_frame: base_link
update_frequency: 15
publish_frequency: 15
static_map: false
rolling_window: true

width: 6.0
height: 6.0
resolution: 0.01

transform_tolerance: 2.0
55 changes: 55 additions & 0 deletions DockerFiles/ROS1.0/catkin_ws/src/chickenbot/launch/chicken.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0"?>

<launch>

<!-- CONFIG -->
<!-- enable_encode = {true, false} -->
<arg name="enable_encode" default="false"/>
<!-- run_rviz = {true, false} -->
<arg name="run_rviz" default="true"/>
<!-- File to record last robot pose -->
<arg name="pose_file_name" value="$(find chickenbot)/config/amcl_pose.yaml"/>

<!-- TF -->
<node pkg="tf" type="static_transform_publisher" name="tf_laser_broadcaster" args="0 0 0 0 0 0 base_link laser 50"/>

<!-- MAP SERVER -->
<node name="map_server" pkg="map_server" type="map_server" args="$(find chickenbot)/map/chicken.yaml">
<!--remap from="map" to="global_map"/-->
</node>


<!-- MY_ODOM is a node who can publish tf(/base_link) and nav_msgs/Odometry(/odom) according to wheel encoders -->
<node pkg="my_odom" type="my_odom_sim" name="my_odom" output="screen">
<param name="cnt_per_cycle" value="75000" />
<param name="wheel_radius" value="0.08" />
<param name="wheel_distance" value="0.502" />
<param name="enable_encode" value="$(arg enable_encode)" />
<param name="enable_amcl" value="$(arg enable_amcl)" />
<param name="pose_file_param" value="$(arg pose_file_name)"/>
</node>

<arg name="costmap_common_params_file" value="$(find chickenbot)/config/costmap_common_params.yaml"/>
<arg name="local_costmap_params_file" value="$(find chickenbot)/config/local_costmap_params.yaml"/>
<arg name="base_global_planner" value="navfn/NavfnROS"/>
<arg name="global_costmap_params_file" value="$(find chickenbot)/config/global_costmap_params.yaml"/>
<arg name="dwa_planner_params_file" default="$(find chickenbot)/config/dwa_planner_params.yaml"/>


<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<param name="controller_frequency" value="1.0"/>
<param name="controller_patiente" value="10.0"/>
<rosparam file="$(arg costmap_common_params_file)" command="load" ns="global_costmap" />
<rosparam file="$(arg costmap_common_params_file)" command="load" ns="local_costmap" />
<rosparam file="$(arg global_costmap_params_file)" command="load" />
<rosparam file="$(arg local_costmap_params_file)" command="load" />
<rosparam file="$(arg dwa_planner_params_file)" command="load" />
<param name="base_global_planner" value="$(arg base_global_planner)"/>
<param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS"/>
</node>


<!-- RVIZ -->
<node pkg="rviz" type="rviz" name="rviz" output="screen" if="$(arg run_rviz)" />

</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0"?>

<launch>

<!-- CONFIG -->
<!-- lidar = {fake_laser, kinect, rplidar, tim551} -->
<arg name="lidar" default="fake_laser"/>
<!-- robot = { yellow, pc_robot, agv1, agv2} -->
<arg name="robot" default="agv2"/>
<!-- enable_encode = {true, false} -->
<arg name="enable_encode" default="false"/>
<!-- enable_encode = {true, false} -->
<arg name="enable_amcl" default="false"/>
<!-- run_rviz = {true, false} -->
<arg name="run_rviz" default="true"/>
<!-- File to record last robot pose -->
<arg name="pose_file_name" value="$(find chickenbot)/config/amcl_pose.yaml"/>


<!-- LIDAR SENSOR -->
<include file="$(find chickenbot)/launch/lidar/$(arg lidar).launch"/>
<arg name="init_x" default="-22.23"/>
<arg name="init_y" default="-16.44"/>
<arg name="init_a" default="0.0"/>

<!-- TF -->
<node pkg="tf" type="static_transform_publisher" name="tf_laser_broadcaster" args="0 0 0 0 0 0 base_link laser 50"/>

<!-- MAP SERVER -->
<node name="map_server" pkg="map_server" type="map_server" args="$(find chickenbot)/map/chicken.yaml">
<!--remap from="map" to="global_map"/-->
</node>


<!-- MY_ODOM is a node who can publish tf(/base_link) and nav_msgs/Odometry(/odom) according to wheel encoders -->
<node pkg="my_odom" type="my_odom_sim" name="my_odom" output="screen">
<param name="cnt_per_cycle" value="75000" />
<param name="wheel_radius" value="0.08" />
<param name="wheel_distance" value="0.502" />
<param name="enable_encode" value="$(arg enable_encode)" />
<param name="enable_amcl" value="$(arg enable_amcl)" />
<param name="pose_file_param" value="$(arg pose_file_name)"/>
</node>

<arg name="costmap_common_params_file" value="$(find chickenbot)/config/costmap_common_params.yaml"/>
<arg name="local_costmap_params_file" value="$(find chickenbot)/config/local_costmap_params_sick.yaml"/>
<arg name="base_global_planner" value="navfn/NavfnROS"/>
<arg name="global_costmap_params_file" value="$(find chickenbot)/config/global_costmap_params.yaml"/>
<arg name="dwa_planner_params_file" default="$(find chickenbot)/config/dwa_planner_params.yaml"/>


<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<rosparam file="$(arg costmap_common_params_file)" command="load" ns="global_costmap" />
<rosparam file="$(arg costmap_common_params_file)" command="load" ns="local_costmap" />
<rosparam file="$(arg global_costmap_params_file)" command="load" />
<rosparam file="$(arg local_costmap_params_file)" command="load" />
<rosparam file="$(arg dwa_planner_params_file)" command="load" />
<param name="base_global_planner" value="$(arg base_global_planner)"/>
<param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS"/>
</node>


<!-- RVIZ -->
<node pkg="rviz" type="rviz" name="rviz" output="screen" if="$(arg run_rviz)" />

</launch>
Loading