| CARVIEW |

Introduction
Robotics Science and System (6.141) is MIT flagship robotics course. In this course, we learn about control, sensing, planning and localization and implement the algorithms in our robot on MIT racecar platform, which is based on Slash and very cool! Builiding an autonomous system like this is an exciting and challenging experience!
Videos!
Final race: Beneficial from our robust lane dectection algorithm and fine tuned pure pursuit controller, our lap time is less than 50s, the race car maintain a 4+m/s even when turnning!
Partical filter and localization: Most rewarding part of the course! Seeing the localization algorithm we wrote actually works is awesome! I also implemented low variance resampling for the filter.
RRT path planning and tracking: Implemented sampling based method to search path given graph map.
A* path planning and tracking: Implemented heuristic search method to search path given graph map.
Line follower and contrller test: Building blocks for advanced tasks! We implemented pure pursuit controller and CV algorithm to detect and track certain path.
What I learned
Here are some thoughts I have after taking this amazing course. We also wrote down all our technical details and experiments charts, analysis in the lab reports. Check them out if interested!
- Good teamwork is important for solving complicated engineering problem. As long as everyone in the team knows what they are doing and how they can push the team forward, the team can actually achieve a healthy balance and make progress. At the mean time, don’t forget to communicate and praise team members!
- Get your hand dirty. As an engineer, the best way to learn is combining theory and implementing together. I appreciate how much MIT values the hands-on experience. The course is very intense, even I have experience in ROS and autonomous roobt before, it’s still challenging to build and make everything work in a short time. And this also pushes my understanding and skill to a new level.
- Know more and see a bigger picture. Robot is a complicated system. To design a system to accomplish certain tasks, there are lots to consider. That’s why konwing the characteritics of different techiniques are important, and analyzing the challenges we are facing and selecting the corret technical roadmap is even more important! Always good to see a big picture when you’re working on something.
- Technical sides:
- A* vs RRT: it’s interesting to see the comparison in real robot. Generally, RRT will find a suboptimal goal faster in large-scale map. But the scale of map is also determined by how we discretize the map. So comparing algorithms in real application and figure out when to use is important. For Stata map, A* is fast enough and provide an optimal solution.
- Pure pursuit controller: it’s very superprised to me how well this simple geometric controller can work on the vehicle. It’s very smooth and tracking error is small in low speed case. But it also comes with some problems: the look-ahead distance is not easy to tune, and the controller can’t handle high speed case esp. with aggressive path dynamics. I would like to combine it with other controllers like LQR in the future to account for vehicle dynamics and achieve better performance.
- Particle filter: this sample-based Bayes filter shows how powerful it is when dealing with non-gaussian noise and localization problem. We also implemented low variance resampling to keep a variety of particles. One downside for PF is the computation. To simulate dyanmics for thousands of particles, compare, update is not a cheap process for on-board computer. Probably using GPU will accelerate this process.
Acknowlegements
This project was done with Nisarg Dharia, Nana Yeboah-Asare Jnr and Meenu Singh. We went through the nights spent in Stata basement together. Thanks for the support from Prof. Luca Carlone and wonderful TAs.

如果你很清楚自己需要什么,也很清楚如何达成自己的目标,那么恭喜你,你可以不需要花时间阅读这篇文章,但这篇文章也许也能给你带来一些新的想法。如果你没有目标,或者只有一个大目标,那么欢迎将这篇文章读完,希望这能给你在南科大学习机器人的过程中添加更多的启示,帮助你在规划过程提供一些参考。
前言
想要了解起一个领域的全貌是不容易的,但却是找到自己方向,知道自己在往哪个方向走的过程中非常重要的一环。对于大一的新同学,这会更难,但我们可以从前人的经验分享中建立基本的概念和认识。杨硕的介绍和机器人工程师升级路线是一个很好的参考。但里面包含的内容十分的多,如果能力允许,能够接近这个目标自然是好的,但如果有找到自己的兴趣和长处,也可以开始聚焦到自己喜欢的方向上。在控制感知两个方向上,赵云天和孙英涵也给了很好的介绍,可以进一步的了解。南科大对科研比较注重,但在机器人领域优秀的科研离不开好的工程积累,许戎汉对于工程的分析值得一看。当你有了对机器人领域究竟在做什么的基本了解之后,我们就来看在南科大有什么打怪升级的招数吧!
大一:打基础,垒常识
欢迎来到南科大!能够在全国最有钱,拥有众多优秀机器人研究者的学校学习,你已经比大部分国内的机器人学生幸运和幸福啦!但你的征途才刚刚开始。 大一不妨给自己定个小目标:学好基础课,积累工程常识。大一是学习基础课的时候,虽然诸如高数和线代的知识会在当下看起来有些枯燥,但绝对会在你未来的工程之路上产生重要的影响,因此沉下心来,好好吸收概念,好好学会如何运用这些知识是非常值得的。此外,每一次基础课成绩也是未来GPA保证。虽然真正的工程和科研能力并不能完全展示在成绩上,但一个好的成绩至少能说明你在某个角度上将知识掌握好了,同时也能为未来发展提供更好的敲门砖。当然了,GPA绝不是唯一,如果你确实不擅长应试和分数也不用过度担心,现在的成绩分数在数年后的工作或者科研中很可能会显得苍白无力。因此不妨去积极探索自己其他擅长的和喜欢的事情吧:或许你在数学题上不甚敏感,但却能在机械设计中涌现出众多点子,那就抓住这一点,让你的优点和你一起发光发热(当然,还是得保证不要挂科)。
工程是一门同时依赖“常识”和数字的学科。在大一培养起基本的工程能力十分重要,包括基本使用工具的能力,能够参与机器人某个部分开发(硬件软件等)的能力。如果你已经有喜欢的课题组,可以积极联系老师开展科研课题。在起步阶段,能有研究生学长指导是最好的,你有机会学习起应会的技能,并且开始了解科研。但更多情况下,你可能对导师们的研究课题名字都摸不着头脑,也不一定有机会找到愿意带本科生参与项目的学长。这时千万别犹豫!去机器人队吧!去参加一个机器人比赛吧! 南科大有几个机器人队,参与了Robomaster或者Robocon等国际知名的比赛,通过队里的训练,你可以真正参与到工程开发中,从队友和学长学到基本的工程技能。最重要的是,能够知道机器人基本是什么。
大一的暑假如果你已经开始科研或者决定暑假继续打比赛,那么恭喜,请坚持下去!但你或许依旧会迷茫,还是觉得自己什么都不会,或许也会规划着上小学期课程。对于仍在观望的同学来说,暑假是跳出自己原有环境去了解,去提升自己的最佳时间。勇敢地申请自己的第一份实习吧!或许你会觉得自己技能不匹配,或许南科大的氛围会让你觉得上课或是科研是更好的选择,但我认为大一暑假实习同样是一件性价比很高的事情。首先工业界的实习能够大大打开你对这个行业的认识,了解社会和行业的需求在哪里。其次,对于本科实习生来说,实习更多是学习和了解的过程,公司并不会给予过高的期望和十分专业的任务。专业上门槛要求并不一定高,但却能让你学到更加专业(professional)的工作的流程,以及相关领域的技能。对于自己领域的认识与靠谱的工作技能会成为你毕业后的杀手锏。
此外南科大在暑假也提供了很多资源。实习上,可以联系院系看有无合作企业内推。课程上也有许多可以能让你自由探索之处,比如SDIM的夏令营,或是机械系的素研夏令营,都是探索新体验和学习的机会。一定要多多留意邮件关注学校新的项目或是机会哦!
大二:尝试与抉择
到了大二,你会发现课程上将会有更多机器人相关专业基础知识的积累,而课程中也会有更多的实践内容。在这个时候,你可以将大一积累的经验知识尝试进一步地将所学的内容结合起来:大一的基础课程内容在哪些地方被这些专业课程所用到?新学的专业知识又可以在哪些地方补充过往的工程经验,更好地解释或是创造解决方案。尝试思考更多的问题可以帮助你将知识学的更加深刻更加灵活。经过高考和应试教育的我们,很多时候可能做题很强,但将知识联系实际进行一些基本思考的能力却有所欠缺。认真观察所学内容的根本,以及他们之间的联系,他们与机器人问题的联系,可以让你跳出课本,对领域各个部分的知识有更好的理解。 大二同样也是进一步思考和规划自己未来方向的好时候。这时的你,有了大一的基础知识积累,和工程经验积累,已经对系里不同老师的课题内容有了大致的认识,而老师们也会欢迎你加入他们的课题组,成为一名本科研究者(科研搬砖人)。我推荐大家去尝试科研并不是因为这就是对的路,而是因为这是非常珍贵的体验和学习机会,和这份资源在南科大是相比其他学校更容易获得的。
在我看来科研和工作有相似之处,也有不同之处。粗略来说科研的乐趣在于发现新知识,做出新的机器人实现新的功能,工作的乐趣在于有着更高的报酬,更深入地了解社会。但两者都需要付出脑力,在机器人领域也往往涉及许多相似的工程实现工作。因此不妨在南科大去尝试一下这份资源,同时学习科研工作中可能需要用的专业技能和其他方面技能,如搜集资料,整理汇报等等。如果发现自己喜欢科研,那么接下来的两年时间,南科大的硬件和师资将成为你学术路开端的最佳垫脚石。如果发现自己不喜欢科研,那么你同样能在学习到更多知识的同时明确自己的方向。
不论如何选择,大二已经可以着手进一步规划未来。如果希望以后继续做科研,可以考虑境外升学和境内读研。南科大考研的氛围并不浓厚,如果能保研会轻松一些。针对需要保研的同学,可以了解一下往年推免的政策,有一些比赛和论文又或是学生活动能为推免加分不少。当然保研中重要的还是GPA。经过MIT一年的交流,我发现南科大的机器人研究上,硬件配置是绝对可以比肩全球最好的高校的,老师们也有很好的学术思维和科研能力,因此保研南科大同样也是很棒的选择。对于境外升学的同学,可以开始思考自己需要怎样的推荐信,需要去哪些实验室做一些怎样的工作。同时开始准备托福或者雅思成绩。托福雅思成绩在未来的交流或者交换中都会有用。尽早准备出成绩,提前尝试是没有坏处的。机械系暑期往往提供了许多国内外顶尖高校的科研实习项目(感谢融亦鸣老师和机械系老师们),如果有合适的项目,千万要努力争取,为自己的科研视野和能力留下浓墨重彩的一笔。如果你已经认定就业是你的目标,那么同样可以寻找优质的公司,进一步积累在业界的实习经历和人脉。
大三:量变到质变
希望大三能够成为你看到自己从量变到质变的阶段。到了大三,相信你已经对机器人的基本面有了充分的了解,能够知道机器人作为一个系统有什么部分,每个部分之间有什么联系,有哪些部分需要关注的。更上一层楼,你也许还了解了机器人科研领域,在设计,电气,算法,系统,应用层面有什么难题和研究热点,也对工业界的机器人开发有了一定了解。
这一年你有机会继续选修更加前沿和细分的内容,比如行走机器人,导航,机器人学习,现代控制等内容,也会逐渐将必修课程完成。更重要的是,此时你的技能积累已经到达了一定高度,无论竞赛,实习,还是科研,都能在一定程度上一展拳脚。这个时候根据自己未来的发展路线,认真选择自己这一年希望达成的项目和讲出故事。对于就业的同学,可以思考哪些项目和竞赛能够支撑自己现在喜欢的方向,能让自己进入喜欢的公司。同理对于做科研的同学,也应该思考这一年有哪些科研课题可以为自己暑假时写文书申请添砖加瓦。不论做什么,都请更加注重质量。一年做出一两个有深度和价值的课题往往会比一年尝试五六个不同的课题都却没什么深入了解来的更有意义。
竞赛和科研是有助于专业能力成长的,但绝不是必需。大三的课程项目也会更加的细分和专业化。能将课程项目做出深度和不一样的地方,同样也是一件了不起的事情。总的来说南科大课程项目是比较水的,但只要你想,仍然大有施展天地。首先将课程项目做好本身就能帮助你将知识学的更加扎实,领悟的更加深刻。其次,作为课堂上的学生,助教和老师都有责任往往也有能力给你提供足够的理论和器材等支持。主动地去提问和尝试,和老师助教多多交流,你肯定能做出优秀的机器人项目!而这些项目都将见证你未来质变的过程,成为你简历上重要的一笔!
大四:开花结果
衷心希望你的大四是开花结果的阶段。如果你的前面三年如上面说的一样充实和精彩,那么恭喜你!你已经可以用自己的积累和能力去选择自己前进的方向了,继续探索,好好享受!同时祝愿你能够申请到理想的学校,或是找到自己理想的工作。当四年后的盛夏,你和好友们在毕业典礼(Commencement)上穿上学士服的时候,也是你们人生的真正开始(commence)之时!
写在最后
尽管上面的打怪升级策略看起来有趣也充实,但也绝不是南科大的唯一打开方式,文章中也有许多没有讨论到的点。比如进行海外学期交换,又应该如何编写自己的故事,安排自己工作和生活。每个人的生活和选择都是独一无人的,衷心希望你探索出属于自己的道路,走出自己的生活,在专业技能不断提升的同时,也拥有让自己的记忆深刻的大学生活。
如果你喜欢机器人,享受在这个专业上成长的历程,那么希望上面的打怪策略能够帮助到你。大学是一个不断积累的过程。也希望你能看到自己在喜欢的领域不断滚雪球,将所学的知识所做的项目慢慢地越滚越大,四年后离开南科大的时候告诉自己,我不枉此行。
本文已经授权给南科大机器人手册使用。欢迎前往机器人手册了解更多在南科大学习机器人的资源!
]]>Hey, what is this?
Our inspiration came from single leg hopping. And we tried to gain some new insights from it. Here are the questions we wanted to answer through the project:
- What is the relative phase between swing and hopping legs that causes the robot to jump the farthest?
- What is the effect of active swing of the swing leg on robot average speed?
Intuitively, we argued that firing the swing leg forward would increase the ground reaction force and therefore leads to a longer hop. But how will the hopping distance vary with different firing time (we called it phase difference between two leg) and the firing time duration? Here comes our hypothesis:
- Active swing leg movement increase average speed of single-leg hopping.
- Phase difference between swing and hopping affect single-leg hopping speed.
- There exists an optimal phase difference between swing and hopping leg to maximize single-leg hopping speed.
Simulation

Deriving the system dynamic

We derived the dynamic using Lagrangian method with five generalized coordinates. To simplify the problem, we fixed the orientation of the hip (at point o). The motors for hip and knee are placed at O and A.
Control scheme overview
In order to control hopping leg behavior during experimental trials, control schemes were found separately for the two legs.
At first, we tried to optimize the whole process for hopping leg (hybrid dynamic with stance+flight). But then we realized it would be hard to find a feasible solution (contact is discrete!). So the hopping leg control was further separated into stance stage and flight stage control schemes to simplify optimization search space.
Stance phase
Optimization tool: CasADI, fmincon(fail)
Objective: maximize the speed before taking off
Decision variables: 4 Bezier control points for knee and hip motor, control time
Constraints:
- torque limits of the motors
- Body should not fall below the ground
- CoM should move forward
- Desired velocity angle
We first tried fmincon, but it failed to solve the problem. Then we tried to use CasADI which is an open-source tool for nonlinear optimization and used IPOPT to solve some feasible solution for stance phase. (thanks for Matt and Se Hwan).
Flight phase
- Hopping leg modelled using spring-loaded inverted pendulum (SLIP) model; defined by length from hip to foot and angle with the ground
- Joint-space PD control to track flight Bezier trajectory Parameterized by takeoff, landing, and two intermediate angles
Swing leg
- Joint-space PD control
- Two key parameters:
phase_shift: relative phase of leg swinging in relation to hopping leg
swing_ratio: duration of leg swing as a percentage of hopping leg stage duration - Actively hold position when not executing swing
- Define phase using beginning of stage
Continuous hopping
- Generate joint position trajectory. We first tried to repeat torque trajectory which failed to generate continuous hopping because it is sensitive to initial condition. So we only replicated joint position trajectory in the continuous hopping.
- Joint space PD control: use optimal joint position trajectory to control stance stage
Result

To look into the effect of two key varibles phase_shift and swing_ratio and sweep over the parameters space, we fixed swing_ratio to 0.3(blue) 0.4(yellow) and 0.5(green) to indicate the effect of phase shift. We used the longest jump joint position trajectory without swing leg as the baseline, which is shown in red.
Phase_shift: range [-1, 1], -1 means completely out phase when the swing leg goes the opposite direction contrast to hopping leg, while 1 means the the swing leg in phase with hopping leg.

phase_shift
Negative phase shifts seems to achieve longer hopping distances than positive ones. In the clear trends for the swing_ratio = .5 curve, the robot hops further when the swing leg leads the hopping leg (phase_shift < 0) than when the swing leg lags the hopping leg (phase_shift > 0). In fact, distance hopped is greater than the baseline control for the former and less than the baseline control for the latter. The curve of best fit hints strongly at a periodic, sinusoidal trend.
swing_ratio
A swing ratio of .5 was most successful for producing valid experimental runs. This is likely due to aggressive swings (swing_ratio = .3) perturbing the system beyond stable hopping behavior, and long swings (swing_ratio = .5) shifting the center of mass of the system for large amounts of time beyond what the hopping control can handle. As impulse is the integral of force over time, we hypothesize that there is a nontrivially optimal swing ratio for each phase shift value such that the system is stable and receives the largest impulse from the swing leg.
Hardware Experiment
Hardware setup

We designed a 3-DoF hopping leg with reference to the lab leg. We used three 12V brushed motor with 19:1 gearbox to drive swing leg and hopping leg. To see the effect of swing leg, we had to add some weight on it which made the robot harder to jump. To make it easier to jump, we used a boom limit its motion and add counter weight on the other end. The boom would influence the motion and change the rotation inertia of the system. But if we made the arm attached to the leg a lot longer than the arm attached to the counter weight, we can neglect the effect of the boom.
Control method
For the stance phase control, we used feedforward torque (from simulation result) + PD control to follow optimized trajectories. For the flight phase control, we used PD control to restore to landing position. The control command frequency is 200hz while motor controller runs at 1000hz.
Hardware experiment

Future Work and Thoughts?
Generally, we were happy about what we achieved at the end. The simulation worked well and we collected some descent data to support our hypothesis. Also, the real robot hopped. During the exploration process, some problems remains:
- Limitation of off-line optimization: due to the fact that we only optimized for the stance phase, we had to control the flight phase and landing manually which is challenging and also no guarantee for optimal solution. In the future, we can modify the off-line optimization to online one, which will be in fact a MPC. And simplifying our optimization problem and doing linearization for dynamic can be essential.
- Contact dynamics is really challenging. There are two parts. First, even with ground truth in simulation, determining the flight time and lift off/landing time is a challenge and will influence the control scheme switch (I heard there are emerging methods to control flight and stance phases together but haven’t looked into it). The second is the contact model and how to handle the dynamic in the optimization. We used soft contact model which treats the ground as a spring and calculate ground reaction force (GRF) from the penetration. There were some undesirable behaviors in landing: the robot will slip for some distance or shake. I think, maybe a more realistic contact model, correct simulation frequency at contact and optimized control for contact can improve the performance.
- Sim-to-Real: transferring the result in simulation to hardware is also difficult. Our model in simulation is not the same in reality. So after transferring the position command into hardware, we didn’t get the robot worked and had to tune the controller again. The sim2real gap is a good reason why the accurate model and robust controller are important.
Acknowlegements
This project was done with Valerie Chen, Cunxi (Jimmy) Dai and Jesse George-Akpenyi. Thanks for the great support from Prof. Sangbae Kim, Se Hwan Jeon, Matthew Chignoli and other TAs.
]]>Keep moving!
Just set up my first personal website and blog here. I will add more contents in the future. I write the blog for myself, but I will be glad to know if there are some helpful information for you. All rational discussion are welcome!
]]>Time for Web Rookie
Yes, I am a web rookie. With the help from Cindy, I explored the basic concepts and use the academic template to build my own website.
Concept time
If you are also a rookie, this concept might be helpful. But if you just want to substitute the content in the template without changing other things, you can ignore this part too.
- jekyll is a static websites generator. It helps transfer the text content and layout to websites. If you hope to preview the website on local machine, you should install it. Or you can also let gitpages help you do that online (but need to push your code and wait for sometimes). Installing it on mac is easy, but installing it on windows can be a pain.
- html: hyper text markup language. You can use it to design the website components and contents.
- css: Cascading Style Sheets. With html element, you can use css to determine how to display them (font, color, size etc.)
- javascript: define the website behavior.
Some Resources
- Install jekyll on windows:
- https://jwillmer.de/blog/tutorial/how-to-install-jekyll-and-pages-gem-on-windows-10-x46
- https://wq133.github.io/2021/03/31/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/#%E4%BA%8Cjekyll
- Setup blog with gitpages:
- https://zhuanlan.zhihu.com/p/77327461
- https://github.com/qiubaiying/qiubaiying.github.io
- https://www.jianshu.com/p/9535334ffd54