0%

[toc]

# Background

Recently, I updated my Ubuntu version from 16.04 to 18.04, and I'd like to share my experience on how to build a work or study environment for yourself.

This blog mainly introduces how to install Sogou pinyin in non-Chinese versions of Ubuntu.

# How to install Sogou pinyin

Firstly, you should install fcitx, a lightweight input method framework aimed at providing environment independent language support for Linux.

You can also uninstall ibus, an input-method framework for Unix-like computer operating-systems.

BTW, you can read Understanding & setting up different input methods if you are interested in the difference between fcitx and ibus.

Recall that: > remove - remove is identical to install except that packages are removed instead of installed. Note that removing a package leaves its configuration files on the system. If a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed.

purge - purge is identical to remove except that packages are removed and purged (any configuration files are deleted too). This of course, does not apply to packages that hold configuration files inside the user's home folder.

what sudo apt autoremove actually does? Whenever you install an application (using apt-get), the system will also install the software that this application depends on. It is common in Ubuntu/Linux that applications share the same libraries. When you remove the appplication the dependency will stay on your system. So apt-get autoremove will remove those dependencies that were installed with applications and that are no longer used by anything else on the system.

You can subsequently open Language Suppor to double-check that Key board input method system has change from ibus to fcitx, and you can change it manuallyif not. You can ignore it and click the "Remind Me later" button if you are reminded that "The language support is not installed completely".

Importantly, you must reboot your system after that.

After that, you can download the deb package from the official website, 搜狗输入法 for Linux, or here (also official links) directly.

You can install it in Ubuntu Software by double-clicking, shown as below.

Importantly, you must reboot your system again.

You can open fcitx config tool after rebooting, as you can see below. You should also see Sogou Pinyin in the lists. Unfortunately, if not, you can add it by clicking the + mark, choose Sogou Pinyin and reboot the system again.

Now, you should input Chinese characters at the same time. In other words, you can use it as convenient in Windows system, like the Shuangpin input method. Yeah, you can learn more detail about Shuangpin in 双拼学习.

Just enjoy Ubuntu 18.04.

# How to install rtags for vim in Ubuntu 18.04 / 如何在Ubuntu 18.04 vim上安装rtags插件

This blog introduces how to install the best cross-reference tool, rtags, that I have ever used in vim, step by step. I hope it helps.

# What's rtags

Rtags is a client/server application that indexes C/C++ code and keeps a persistent file-based database of references, declarations, definitions, symbolnames etc. It allows you to find symbols by name (including nested class and namespace scope). Most importantly, it gives you proper follow-symbol and find-references support.

Rtags comes with emacs support but there are projects supporting other IDEs: vim-rtags and sublime-rtags.

In this blog, We would install vim-rtags later.

# How to install rtags

First, you need clang, which is a compiler front end for the C, C++, Objective-C and so on. It uses the LLVM compiler infrastructure as its back end and has been part of the LLVM release cycle since LLVM 2.6.

Secondly, make and install rtags as follows.

Thirdly, you should install vim-rtags in Vundle.vim. I think it's the easiest way to install rtags plugin in vim. You need to add the following line to .vimrc if you have installed Vundle, and then run :PluginInstall in vim.

Finally, the last but essential step is that forcing cmake to output compile_commands.json (like DCMAKE_EXPORT_COMPILE_COMMANDS) and link it with rtags according to your project.

[toc]

# 前言

Website FAQ，实现了使用"卜算子"来统计网站访问人数，但是"卜算子"仅可以提供访问人数的统计，进一步的信息却无法提供。那么，如果想知道过往访客来自哪些国家和地区，显示网站访问实时动态的信息，应该怎么做呢？

# clustermaps 是什么

clustrmaps.com 是美国的一家数据网站，能够汇总公共记录来分析美国城市的社会人口和商业环境。

Add the ClustrMaps hit tracker to your site or blog and see a real-time map of your visitors from around the world! Proudly show and grow your hidden community of interest.

# 配置 clustrmaps

• 选择自己喜欢的插件格式，现在 Hexo 的 Next 两种主题都是支持的，但是自己比较喜欢 Map widget 的主题。

• 点击选择后，拷贝网站出现的脚本 javascript代码，粘贴到Next主题下某个位置。博主测试过如下两个位置，挑选一个配置即可以。推荐位置二，自定义程度高。
• 位置一：将代码插入到 themes\_partials.swig 的最后。

• 位置二：将代码插入到 \_macro.swig 文件的

图层。

• 重新部署网站，就可以在首页看到实时访客来源图，如我的网站首页所示。另外，点击地图，可以看到更详细的信息，包括访客的地图、浏览设备以及 IP。

《莫斯科绅士》讲述的是在沙皇被推翻之后，一个沙皇伯爵回到俄国，被软禁在莫斯科大都会酒店度过一生的故事。作者通过伯爵的回忆，简单描述了沙皇时期贵族的一些生活场景，又以伯爵的视角，通过描绘大都会酒店的变化，侧面反映了俄国的政治、社会变化。

You cannot teach an old dog new tricks.

2019年2月，新的技能选择学习小众的「双拼」输入法

# 如何学习双拼

## 小鹤双拼学习

4. 把需要记忆和背诵的键位打印出来，放显示器旁边，然后关掉输入法的双拼同时使用全拼，开心去聊吧； - 生命短暂，时间宝贵，强烈建议直接上手，不要把时间浪费在「双拼」练字上。

## 友情链接

• 2019年02月19日创建，陆续增添补充链接；
• 2019年02月24日文章基本成型，陆续发表到各平台；

[toc]

# Hexo 配置

• Q: 如何修改 hexo d 命令的端口
• A: 如果服务器/VPS的SSH端口不是默认的22，那么需要对本地 _config.yml 文件的 deploy 字段，做如下修改：
• Q: Next主题busuanzi_count访客统计失效
• A: 卜算子官网 提示，"因七牛强制过期『dn-lbstatics.qbox.me』域名，与客服沟通无果，只能更换域名到『busuanzi.ibruce.info』"，所以需要修改卜算子在next主题插件里面的域名。
其中，hexo-theme-next主题中使用了dn-lbstatics.qbox.me域名的文件位置为：hexo\_third-party-counter.swig.

# NextCloud 配置

• Q: 浏览器只能上传到 nextcloud 服务器 1M 小容量文件
• A: 上传文件大小限制，主要由 nginx 配置文件中的client_max_body_size的值决定，其默认值为 1M，我们根据需求调整其大小。
1. 修改 nginx 配置文件目录下的 nginx.conf 文件 (一般路径是/etc/nginx/nginx.conf)，增加如下图所示红色内容。

1. 重启 nginx
2. 检查 nginx 配置状态

# 邮件服务器配置

• Q: 免费邮件服务器配置
• A: Yandex，一家来自俄罗斯的域名邮箱提供商，可以搭建免费的域名邮局，免费账户支持POP、SMTP，还支持API。唯一的缺点是海外商家，官网速度比较慢，科学上网。

# 更新 letsencrypt 证书

• Q: letsencrypt的https证书期限是3个月，到期后如何重新更新证书呢？
• A: certbot renew
// 上面的指令不成功，换成下面的指令，重新申请证书，不需要改配置
// sudo certbot --force-renew
• Q: 在 Centos 7 上如何更新 letsencrypt ?

• A: /root/certbot-auto renew
// 上面的指令不成功，换成下面的指令，重新申请证书，不需要改配置
// sudo /root/certbot-auto --force-renew

You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=your.site

• Q: Renew 失败，报错信息如下： > Attempting to renew cert (www.xx.net) from /etc/letsencrypt/renewal/www.xx.net.conf produced an unexpected error: 'ascii' codec can't decode byte 0xe8 in position 57: ordinal not in range(128). Skipping.

All renewal attempts failed.

• A: 解决方法：可能 nginx 配置文件中有中文注释，删掉之后即可 renew 成功。可参考 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 2: ordinal not in range(128)

# Hexo 提示 “TypeError[ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string ” 解决办法

• Q：在网站部署过程中，Mac 系统中 “hexo d” 会提示 TypeError[ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string。

• A：这是因为安装的 node 版本过高导致的。Hexo 官网对 node 的版本要求是不低于10.13，推荐12.0 或更高版本。

Node.js (Should be at least Node.js 10.13, recommends 12.0 or higher)

截止在 2021 年 9 月，实践发现 LTS 14.17 版本并不适配最新版的 hexo，所以对 hexo 升级是解决不了这个报错问题。变通的方法是对 node 版本降低，安装 12.0 版本可以解决问题。

在 mac 上如何降级 node 版本，如下。详细可参见 homebrew 安装指定版本node

[toc]

In this paper, a navigation method for a small size hopping rover with advantages on its mobility is discussed by considering with some uncertainties caused by jumping behavior and measurement error.

By extracting obstacles from environmental data and constructing triangular polygons it is possible to form paths. The algorithm considers with safety of collision with obstacles, roughness of terrain and failures of hopping action, and then could generate safer path based on A* algorithm.

# INTRODUCTION

One possibility is the introduction of a light and compact exploration robot agent, and it is possible that multiple types of agents work together in one system. Various roles (functions) can be played on various kinds of equipment, and all of them can constitute one exploration system.

By allocating the same function (equipment) to some or many of them, it is possible to ignore some percentage of the agent's loss rate, so that risk can be distributed to the system and the mission and there is a high possibility of obtaining higher efficiency.

However, its size causes problems on its traversability and measurement ability.

We have introduced hopping mobility to obtain higher traversability and wider measurement range.

Introduction of two types of rovers is being considered in the exploration system. One is a land-based agent and a stochastic existence region is given in the search region, contributing to the search of the ground surface. The other is hopping rover. the rover that makes path planning taking advantage of sensing from high places while moving the exploration area together with the ground moving rover plays an important role.

• 相比轮式机器人，在低重力环境下 (low gravitational environment)，可以通过跳跃的方式跳过障碍物，从而抄近路 (adopt a short-cut path)。

Especially under low gravitational environment such as other planet or satellite, it indicates higher performance, e.g.Thus, it can jump over a long distance upon terrains and obstacles, adopt a short-cut path without a detour of a wheeled type, and also measure an environment from higher position in the air of jumping trajectory.

# ISSUE AND OBJECTIVES

• 为什么导航问题需要研究：现有的导航研究，没有利用跳跃机器人的运动特性 (文章发表于2017)，所以需要进一步利用跳和远距离的优势来导航。

For a hopping rover, though a lot of jumping hardware designs have been studied, its software e.g. navigation algorithms have been discussed hardly. So, the navigation method hasn't been established by taking advantage of hopping mobility such as jumping over obstacles or a long distance yet.

In this paper, a navigation method for a small size hopping rover with advantages on its mobility is discussed with some risk considerations on its mobility and measured data.

# PATH PLANNING FOR HOPPING MOBILITY

## Selection of Jumping Target Position

The uncertainty factor of hopping rover's jumping motion is the initial speed change, jump distance, jumping direction, bound after landing, failure of leap.

### 如何环境建模

1. 连接被识别到的障碍物，构成不规则三角形的环境模型。

Each obstacle captured by sensing is connected and the observation area is divided into triangles

1. 在观测到的障碍物上使用狄洛尼三角剖分 (Delaunay triangulation)，可以获得每三个点的外心(outside heart)，即可能的落地点。

By using Delaunay triangulation on the observed obstacles, we can set the landing point.

> Delaunay三角剖分定义：平面上的点集P是一种三角剖分，使得P中没有点严格处于剖分后中任意一个三角形**外接圆**的**内部**(可以是圆上)。

Since the outer heart is equally distant from each vertex, it can be said that it is safe if a certain margin can be secured.

Safety distance is secured by creating a circumscribed circle (其实是 delaunay triangulation) so as not to include other obstacles in the circle

## Candidate Path Network

1. 通过连接外心，可以得到一个维诺图 (Voronoi diagram)。

The Voronoi diagram is a method of dividing the region by joining the outer centers formed by Delaunay triangulation.

MC: 什么是 Voronoi diagram？ Voronoi diagram

> 泰森多边形是对空间平面的一种剖分，其特点是多边形内的任何位置离该多边形的样点（如居民点）的距离最近，离相邻多边形内样点的距离远，且每个多边形内含且仅包含一个样点。

It can be confirmed that there are no obstacles on the sides of the Voronoi diagram enclosing the obstacles and safe nodes can be generated.

The error is generally given in the form of a normal distribution, which rides on the initial speed, the jumping angle, and the direction angle, respectively.

The position of the rover can be indicated as the existence probability, and generally takes a shape called an error ellipse.

MC: 通过椭圆来表示误差和不确定性，算是一个新奇的做法。

# SIMULATION OF PATH PLANNING

Even if the obstacle is the size of the black part of the figure.

Simulation was also carried out in the virtual lunar environment created based on the rock distribution collected by “Surveyor 7” of NASA.

When the occupancy rate of the obstacle in the error ellipse exceeds the threshold value, the rover performs self-position estimation.

# CONCLUSION

## The results of this research

• In consideration of the uncertainty of the hopping rover, we were able to determine a safe landing point.
• By performing self-position estimation in the virtual lunar environment, it was possible to induce Rover while suppressing position error.

## Works to do

• 路径规划限于2维，缺乏对障碍物和跳跃高度的考虑。
• 如何切分大的障碍物，而不仅仅是把障碍物作为质点考虑。
• 跳跃机器人的设计，物理构建，环境识别，以及规划好路径后，如何对跳跃行为进行控制，准确抵达目标点。

[toc]

Systematic variation of forcing parameters reveals complex dynamics which are sensitive to amplitude, phase and frequency.

# Introduction

• 本文分析简单运动模型的意义：为复杂设备的简单控制提供指导，揭露生物运动的原理。

Simple models have the ability to be fully analyzed and can thus provide guidance for simplifying control of more complex devices, and even reveal principles of biological locomotion.

• 研究背景：在越过复杂地形时，生物启发的跳跃机器人是轮式机器人的一个替代。目前，跳跃的最优策略往往是基于经验来调试，瞬间行为(如离地跳跃)的动态系统分析(dynamics of transient behaviors)是相对少的。

In robotics, biologically inspired legged jumping robots have been constructed as an alternative to wheeled robots to better traverse rough terrain.

The initial movement strategies for optimal jumping are typically chosen by empirical tuning for steady state hopping or squat jumps. Systematic studies of the dynamics of transient behaviors, critical to issues of lift-off, are relatively scarce.

# Experiment and model

• 硬件设计：线性马达+弹簧+推力棒+空气轴承(摩擦小)

The robot consisted of a linear motor actuator with a series spring rigidly attached to the bottom end of the actuator’s lightweight thrust rod. The actuator was mounted to an air bearing which allowed for 1D, and nearly frictionless, motion.

• 马达(actuator)相对轴承(bearing)的力量有限，所以通过倾斜来减少重力，但我不太理解这番话蕴含的物理意思，无法想象轴承和马达的位置关系是什么。

Due to power limitations in the actuator, the bearing was inclined at 15 degree relative to the horizontal, reducing gravitational acceleration to 0.276g.

• 马达相对于驱动棒(thrust rod)底部的位置关系表达式，如下所示。

• 设计巧妙处，利用电路(open circuit)做传感器，统计跳跃时间和高度，简单且精度高。

To detect lift-off, a continuity sensor attached to the bottom of the metal spring measured an open circuit when the spring left the ground.

A constant coefficient of restitution of 0.8 (measured from experiment) modeled the collision of the spring with the ground.

# Lift off and jump height

• 只研究马达运行一次的跳跃表现。

Since we were interested in rapid jumps from rest, actuator forcing was then restricted to only one cycle (N = 1). We systematically examined jumping height for N = 1.

## 两种跳跃模式

• 单次跳(single jump)

In the single jump mode, the robot compressed the spring and was propelled into the air.

• 突突跳(stutter jump)

In the stutter jump mode, the robot performed a small initial jump followed by a larger second jump.

## Single jump vs Stutter jump

• 起跳时间：The time to lift-off was smaller for single jumps than stutter jumps.

# Theory of transient mixing

• 看似简单的等式一，因为参数 $$\alpha$$ 的线性，更像是一个分段线性动态系统 (piecewise linear dynamical systems)，包含一系列复杂的行为。

• 基于等式一，理论分析为什么最佳跳跃不是发生在谐振频率。

We are particularly interested in why optimal jumps occur only off resonance.

## Single jump

Moving off resonance, the prefactor favors higher f over lower, so the optimum f lies somewhat above $$f_{0}$$ (resonance). This argument holds regardless of A.

## Single jump vs Stutter jump

• 最佳突突跳(stutter jump)的频率带宽(narrow frequency bandwidth)比较窄。 > This sensitivity to proper timing explains the narrow frequency bandwidth required to achieve optimal jump heights using the stutter jump mode.
• 最佳突突跳的频率强依赖幅值，单次跳则没有明显依赖。 > A further consequence is a strong dependence of optimal f with respect to A.
• 和单次跳跃相比，突突跳达到相同高度的消耗能量要少一个数量级。 > Thus the stutter jump is energetically advantageous since it has a lower optimal f than the single jump. In fact, the stutter jump uses nearly an order of magnitude less power to achieve comparable jump height to the single jump.

# Conclusion

## Works have done

• 发现突突跳，使用的能量少，但是跳跃高度高，性价比高。 > The system becomes hybrid for certain parameters as a stutter jump emerges. This mode achieves comparable jump height but uses less power.
• 研究成果和已有结论相符 > Biologically, our model is in accord with a previous model of bipedal jumping which predicted that counter-movement achieves greater jump height than the squat jump. A quick single jump that resembles a squat jump is beneficial when a fast escape is essential, while a slower stutter jump similar to a counter-movement can achieve comparable jump height.

## Works to do

• 研究其他影响因素，如系统固有性质和环境的影响 > how other factors, intrinsic and environmental, affect optimal performance
• A non-sinusoidal actuation could improve jump height, take off time, or efficiency.
• Animals jump off compliant surfaces (like tree branches) and from deformable substrates (like sand).
• 如何结合 Single jump 和 Stutter jump，取得更优的表现。

[toc]

# 目标和方法

1. 从频谱仪中导出频谱仪 I/Q 数据；
2. 在 matlab 上编程实现基于 I/Q 数据的多帧 ASK 和 FSK 解调；
3. Matlab 解调结果和频谱仪基本吻合，并实现解调自动化。

# 导入 I/Q 数据

• Y 是一个复变量，包含了采样数据点的同相 I 分量和正交 Q 分量。
• InputCenter 显示了采样时的中心频率，据此可计算出实际频率分量。
• InputZoom 值为1，表示采集数据已下变频到基带。
• XDelta 为采样周期，由此可以计算出采样率 (fs=1/XDelta)。

## IQ 数据简介

I/Q 直角坐标图表示矢量的参数不是直接的幅值和瞬时相位，而是把它们投影在 I/Q 直角坐标轴上，采用 I 轴和 Q 轴的投影分量来确定矢量。

## 数据分析

• 输入信号的幅度 $$Am$$ 分析： $$Am=\sqrt{I^{2}+Q^{2}}$$ 。根据 I/Q 信号的每一个采样值，可以计算出对应采样时刻的幅度值。在测量时间内的所有幅度数值构成 I/Q 幅度数组，对应于“射频功率－时间曲线”。

• 输入信号的相对相位 $$\Phi m$$ 分析： $$\Phi m=arctan(Q/I)$$ 。根据 I/Q 信号的每一个采样值，可以计算出对应采样时刻的相对相位值。在测量时间内的所有 $$\Phi m$$ 数值构成 I/Q 相对相位数组 $$\Phi m$$

• 输入信号的频率 $$F m$$ 计算：$$F m = \frac{d(\Phi m)}{dt}$$ 。在测量时间内的所有 $$F m$$ 数值构成 I/Q 频率数组 $$F m$$，对应于频率曲线。

• 频谱计算：Spectrum = FFT(Y)。对 I/Q 数据 Y 进行傅里叶变换，即可计算出其频谱值。其中，Spectrum 为输入信号中频带宽内的频谱。

## 解调实例分析

### FSK 解调实现

FSK就是用数字信号去调制载波的频率，FSK解调一般采用两种方式：非相干解调和相干解调。

Matlab代码为：

ASK 是振幅键控方式，这种调制方式是根据信号的不同，调节正弦波的幅度。这里参考上述计算幅值 $$Am$$ 的公式，将频谱仪导入的 I/Q数据计算瞬时幅值。

Matlab 代码为：