markdown

markdown


转义字符 \

可转义字符

\   backslash
`   backtick
*   asterisk
_   underscore
{}  curly braces
[]  square brackets
()  parentheses
#   hash mark
+   plus sign
-   minus sign (hyphen)
.   dot
!   exclamation mark

水平分割线

  • 要生成水平分割线 可以在单独一行里输入3个或以上的短横线 星号或者下划线实现

  • 短横线和星号之间可以输入任意空格





---
*** (******)
- - -
* * *

引用

ref to xxx

> ref to xxx

多级引用

这是一级引用

这是二级引用

这是三级引用

> 这是一级引用
>> 这是二级引用
>>> 这是三级引用

plaintext / 代码

使用 ` or ```

代码
```
代码
```

行首 tab

代码
    代码

或者四个空格 行开头

代码
    代码

title

# h1

## h2

...

###### h6

or

a first level header
====================
a second level header
---------------------

# this is an h1 #

## this is an h2 ##

### this is an h3 ###

强调

  • markdown 使用星号和下滑线来标记强调

斜体

*斜* _体_

加粗

**加** __粗__

列表

  • 无序列表使用星号 * 加号 + 和减号 - 来做为列表的项目标记

减号

  • Candy.
  • Gum.
  • Booze.
- Candy.
- Gum.
- Booze.

星号

  • Candy.
  • Gum.
  • Booze.
* Candy.
* Gum.
* Booze.

加号

  • Candy.
  • Gum.
  • Booze.
+ Candy.
+ Gum.
+ Booze.

链接

  • Markdown 支援两种形式的链接语法: 行内 和 参考 两种形式

  • 两种都是使用角括号来把文字转成链接

行内形式是直接在后面用括号直接接上链接

Let’s go

Let's [go](https://example.com)

可以选择性的加上 title 停留在上面时的 hint

Let’s go.

Let's [go](https://example.com "Example").

直接引用

https://example.com

<https://example.com>

图片

  • 图片的语法和链接很像

行内形式 无 title

awesome

![awesome](https://yuiwong.org/gitlab/uploads/project/avatar/71/awesome-badge.png)

行内形式

awesome

![awesome](https://yuiwong.org/gitlab/uploads/project/avatar/71/awesome-badge.png "awesome")

参考链接

[go][home]
![awesome][awesome]
[home]: https://yuiwong.org
[awesome]: https://yuiwong.org/gitlab/uploads/project/avatar/71/awesome-badge.png
[goto references](#references)

see also https://yuiwong.org/gitlab/awesome/markdown

references

Install and config gitlab-ce

Install and config gitlab-ce

(2017-04-02 +0800)

  • Host: ubuntu 16.04.2 or … LTS
  • Gitlab: gitlab-ce

https://yuiwong.org/gitlab/server/serverbuilding/blob/master/gitlab/gitlab-ce.md

Steps

Requirements

Check whether your server meets the hardware requirements.
GitLab packages are built for 64bit systems.
For 32bit OS, consider alternative installation methods.

Install and configure the necessary dependencies

If you install postfix to send email please select ‘internet site’ during setup.
instead of using Postfix you can also use Sendmail
or configure a custom SMTP server
and configure it as an SMTP server.

Here use Postfix: config is DOMAIN of the administrator email!!

sudo apt-get install curl openssh-server ca-certificates postfix

# Simple reconfigure postfix by reinstall
sudo apt-get purge postfix
sudo apt-get install postfix

Add the gitlab package server and install the package

# NOT by this mirror
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

# BUT
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
add:
deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main
to: /etc/apt/sources.list.d/gitlab-ce.list

# then
sudo apt-get update
sudo apt-get install gitlab-ce

CONFIGURE AND START GITLAB

Fixed !!
!!!!
sudo dpkg-divert --local --rename --add /sbin/initctl
sudo ln -s /bin/true /sbin/initctl
NO login git account!!
sudo useradd -r git -s /usr/sbin/nologin
Postgresql
sudo apt-get install -y postgresql postgresql-client libpq-dev postgresql-contrib
sudo -u postgres psql -d template1 -c "CREATE USER git CREATEDB;"
sudo -u postgres psql -d template1 -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
sudo -u postgres psql -d template1 -c "CREATE DATABASE gitlabhq_production OWNER git;"
sudo -u git -H psql -d gitlabhq_production
sudo -u postgres psql -d template1 -c "ALTER ROLE git WITH PASSWORD 'YOUR_PASSWD';"
With external HTTP server

Apache or ngnix …: configure rewrite, redirect!

Apache2 and “redirect http requests to https”
and “Using a non-bundled web-server”…
https://docs.gitlab.com/omnibus/settings/nginx.html#using-a-non-bundled-web-server
https://gitlab.com/gitlab-org/gitlab-recipes/blob/master/web-server/apache/gitlab-omnibus-ssl-apache24.conf

TODO: ngnix

Examples

  • NO SSL + with prefix apache configuration:
  • SSL + with prefix apache configuration TODO
  • SSL + NO prefix apache configuration TODO
Or without external HTTP server

Just use workhorse, e.g. ...:8181

Reconfigure gitlab

Configuring the external URL for GitLab

Configuring a relative url for gitlab

# Set the external_url in /etc/gitlab/gitlab.rb:
external_url "https://example.com/gitlab"
# My
external_url "https://yuiwong.org/gitlab"

# Reconfigure GitLab for the changes to take effect:
sudo gitlab-ctl reconfigure

# Restart gitlab in case you shut down unicorn and sidekiq in the first step:
sudo gitlab-ctl restart

Example /etc/gitlab/gitlab.rb
conf/gitlab.1.rb
TODO more

Reconfigure

sudo gitlab-ctl reconfigure

Restart

sudo gitlab-ctl restart

Browse to the hostname and login

On your first visit,
you’ll be redirected to a password reset screen to provide the password
for the initial administrator account.
Enter your desired password and you’ll be redirected back to the login screen.

The default account’s username is root.
Provide the password you created earlier and login.
After login you can change the username if you wish.


For configuration and troubleshooting options please see the
Omnibus GitLab documentation
If you are located in China, try using
https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/


References

Levels of Motion Control

Levels of Motion Control

Controlling a mobile robot can be done at a number of levels
and ROS provides methods for most of them.
These levels represent different degrees of abstraction,
beginning with direct control of the motors
and proceeding upward to path planning
and SLAM (Simultaneous Localization and Mapping).

Motors, Wheels, and Encoders

Most differential drive robots running ROS use encoders
on the drive motors or wheels.
An encoder registers a certain number of ticks
(usually hundreds or even thousands) per revolution of the corresponding wheel.
Knowing the diameter(直径) of the wheels and the distance between them,
encoder ticks can be converted to the distance traveled in meters
or the angle rotated in radians.
To compute speed,
these values are simply divided by the time interval between measurements.

This internal motion data is collectively known as odometry
and ROS makes heavy use of it as we shall see.
It helps if your robot has accurate and reliable encoders
but wheel data can be augmented using other sources.
For example, the original TurtleBot uses a single-axis gyro(陀螺仪)
to provide an additional measure of the robot’s rotational motion since
the iRobot Create’s encoders are notably inaccurate during rotations.
It is important to keep in mind that no matter
how many sources of odometry data are used,
the actual position and speed of the robot in the world can
(and probably will)
differ from the values reported by the odometry
.
The degree of discrepancy will vary depending on the environmental conditions
and the reliability of the odometry sources.

Motor Controllers and Drivers

At the lowest level of motion control we need a driver for the robot’s motor
controller that can turn the drive wheels at a desired speed,
usually using internal units such as encoder ticks per second
or a percentage of max speed.
With the exception of the Willow Garage PR2 and TurtleBot,
the core ROS packages do not include drivers for specific motor controllers.
However, a number of third-party ROS developers have published drivers
for some of the more popular controllers and/or robots
such as the ArbotiX, Serializer, Element, LEGO® NXT and Rovio.
(For a more complete list of supported platforms,
see Robots Using ROS.)


The ROS Base Controller

At the next level of abstraction,
the desired speed of the robot is specified in real-world units
such as meters and radians per second.
It is also common to employ some form of PID control.
PID stands for “Proportional Integral Derivative(比例积分导数)”
and is so-named because the control algorithm corrects the wheel velocities
based not only on the difference (proportional) error between the actual
and desired velocity,
but also on the derivative and integral over time.
You can learn more about PID control on Wikipedia.
For our purposes, we simply need to know that the controller
will do its best to move the robot in the way we have requested.
The driver and PID controller are usually combined inside a single ROS node
called the base controller.
The base controller must always run on a computer attached directly to
the motor controller
and is typically one of the first nodes launched when bringing up the robot.
A number of base controllers can also be simulated in Gazebo
including the TurtleBot,
PR2
and Erratic.

The base controller node typically publishes odometry data on the
/odom topic and listens for motion commands on the /cmd_vel topic.
At the same time, the controller node typically (but not always) publishes
a transform from the /odom frame to the base frame
either /base_link or /base_footprint.
We say “not always” because some robots like the TurtleBot,
uses the robot_pose_ekf
package to combine wheel odometry
and gyro data to get a more accurate estimate of the robot’s position
and orientation.
In this case, it is the robot_pose_ekf node that publishes
the transform from /odom to /base_footprint.
(The robot_pose_ekf package implements an Extended Kalman Filter as you can
read about on the Wiki page linked to above.)

Once we have a base controller for our robot,
ROS provides the tools we need to issue motion commands
either from the command line or by using other ROS nodes
to publish these commands based on a higher level plan.
At this level, it does not matter what hardware
we are using for our base controller:
our programming can focus purely on the desired linear and angular velocities
in real-world units and any code we write should work on
any base controller with a ROS interface.

Frame-Base Motion using the move_base ROS Package

At the next level of abstraction,
ROS provides the move_base
package that allows us to specify a target position
and orientation of the robot with respect to some frame of reference;
move_base will then attempt to move the robot to the goal
while avoiding obstacles
.
The move_base package is a very sophisticated path planner
and combines odometry data with both local and global cost maps
when selecting a path for the robot to follow.
It also controls the linear and angular velocities and accelerations
automatically based on the minimum and maximum values we set
in the configuration files.

SLAM using the gmapping and amcl ROS Packages

At an even higher level,
ROS enables our robot to create a map of its environment using
the SLAM gmapping package.
The mapping process works best using a laser scanner
but can also be done using a Kinect or Asus Xtion depth camera to provide
a simulated laser scan.
If you own a TurtleBot,
the TurtleBot stack includes all the tools you need to do SLAM.

Once a map of the environment is available,
ROS provides the amcl package
(adaptive Monte Carlo localization) for automatically localizing the robot
based on its current scan and odometry data.
This allows the operator to point and click on any location
on a map and the robot will find its way there while avoiding obstacles.
(For a superb introduction to the mathematics underlying SLAM,
check out Sebastian Thrun’s online Artificial Intelligence
course on Udacity.)

Semantic Goals (语义目标)

Finally, at the highest level of abstraction,
motion goals are specified semantically such as
“go to the kitchen and bring me a beer”, or simply, “bring me a beer”.
In this case, the semantic goal must be parsed and translated
into a series of actions.
For actions requiring the robot to move to a particular location,
each location can be passed to the localization and path planning levels
for implementation.
While beyond the scope of this volume,
a number of ROS packages are available to help with this task
including smach, executive_teer, worldmodel, semantic_framer,
and knowrob.

In summary, our motion control hierarchy looks something like this:

   goal
-> amcl
-> path planner
-> move_base
-> /cmd_vel + /odom
-> base controller
-> motor speeds

ref.