Advanced Topics for Robotics 代做、代写C++设计程序
April 8, 2024
Advanced Topics for Robotics
Homework 1
<!-- ## Instructions and Announcements
There is one programming problem in this assignment.
Before beginning this task, please be aware that you may need to configure a virtual machine
and install an operating system to complete this assignment.
Please record the result as a video and submit it together with your source code.
Collaboration policy. Discussions with others are strongly encouraged. However, you should
implement the idea on your own.
If you have any questions about this assignment, please don't hesitate to reach out to Prof.
Chen or the TA : ) -->
Introduction
In this assignment, you will learn and practice setting up the robotics development environments
and using a powerful open-source codebase to run Model Predictive Control (MPC) for a
quadrupedal robot.
Specifically, you will first set up necessary development tools such as Robot Operating System
(ROS). ROS is a set of software libraries and tools that help you build robot applications, from
drivers to state-of-the-art algorithms, and with powerful developer tools. For more details, please
see ROS tutorials.
You will then install one of the state-of-the-art MPC solver called Optimal Control for Switched
Systems (OCS2). OCS2 is a C++ toolbox that provides an efficient implementation of several
advanced MPC algorithms such as Sequential Quadratic Programming (SQP) and Differential
Dynamic Programming (DDP).
To begin with, you need to follow the step-by-step instructions to install and configure the
development environments as well as OCS2. Once you have completed the configuration, you will
receive 60% of the homework marks.
After completing the configuration, you will need to modify a bit of the OCS2 code based on the
given tips to enable the quadruped robot to execute two new gaits. This section will account for
40% of your mark for this assignment.
Please note:
Before beginning this task, please be aware that you may need to configure a virtual machine
and install an operating system to complete this assignment.
Collaboration policy. Discussions with others are encouraged. However, you should
implement the idea on your own.
If you have any questions about this assignment, please don't hesitate to reach out to Prof.
Chen or the TA : )
Prerequisites
The following are the prerequisites for compiling and running OCS2:
Ubuntu 20.04. We strongly recommend that you use the Ubuntu 20.04 operating system for
this assignment. OCS2 is tested under Ubuntu 20.04 with library versions as provided in the
package sources. If your computer's operating system is not Ubuntu 20.04, you can also use
VMware to build a virtual machine. It is not recommended to use other common virtual
machines, such as Parallel Desktop and VirtualBox, because the limitation of graphics
memory may lead to poor rendering effects.
2-core processor (Intel/AMD CPU).
The minimum requirement for the processor is 2-core, but we highly recommend
using 4-core processor.
6GB RAM.
While the minimum requirement for RAM is 6GB, we strongly suggest using 10GB RAM
for optimal performance.
30 GB of free hard disk space.
You can download the desktop image for Ubuntu 20.04 from: https://releases.ubuntu.com/20.04/ .
If your operating system is Windows or Linux, you may consider using VMware Workstation
Player as your virtual machine.
If your operating system is macOS, you may consider using VMware Fusion as your virtual
machine.
Dependencies
Please run sudo apt update && sudo apt upgrade in the command-line interface to ensure the
source of each package.
C++ compiler with C++11 support (Default package in Ubuntu 20.04).
Eigen (v3.3) (Default package in Ubuntu 20.04).
Boost C++ (v1.71) (Default package in Ubuntu 20.04).
ROS (Noetic). Ubuntu install of ROS Noetic.
GLPK, URDFDOM, OCTOMAP, ASSIMP sudo apt install libglpk-dev liburdfdom-dev
liboctomap-dev libassimp-dev .
catkin. (When you install ROS, it will be installed together.)
pybind11_catkin, ROS package, installable via sudo apt install ros-noetic-pybind11-
catkin ros-noetic-grid-map-rviz-plugin .
catkin-pkg package for python3. Install with sudo apt install python3-catkin-tools .
Doxygen for documentation. Install with sudo apt install doxygen doxygen-latex
Git. Install with sudo apt install git .
If you find that using the apt command is slow, you can refer to https://mirrors.tuna.tsinghua.ed
u.cn/help/ubuntu/ to change the source of apt. However, this is not a necessary step.
Installation and setup
1. Create a new catkin workspace:
Catkin is a build system used primarily within the Robot Operating System (ROS) ecosystem. It is
designed to manage the compilation, packaging, and distribution of multiple interdependent software
packages, or "packages," that make up a ROS project. Catkin streamlines the build process by handling
dependencies, ensuring that packages are built in the correct order, and allowing for easy integration
with other tools in the ROS ecosystem.
2. Clone the OCS2 and other necessary libraries:
Software packages used in the project are placed in the src folder of the workspace.
3. Remove packages that are not useful for this homework:
4. Build and run the unit tests:
# Create the directories
# Do not forget to change <...> parts
# You can use any <directory_to_ws> and <catkin_ws_name>.
# In my personal experiment,
# I choose `~/workstation`(without quotes) for <directory_to_ws>,
# and `hw1`(without quotes) for <catkin_ws_name>.
mkdir -p <directory_to_ws>/<catkin_ws_name>/src
cd <directory_to_ws>/<catkin_ws_name>/
# Initialize the catkin workspace
catkin init
catkin config --extend /opt/ros/noetic
catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo
# Navigate to the directory of src
# Do not forget to change <...> parts
cd <directory_to_ws>/<catkin_ws_name>/src
# Clone OCS2, pinocchio, hpp-fcl, and ocs2_robotic_assets.
git clone https://github.com/leggedrobotics/ocs2.git
git clone --recurse-submodules https://github.com/leggedrobotics/pinocchio.git
git clone --recurse-submodules https://github.com/leggedrobotics/hpp-fcl.git
git clone https://github.com/leggedrobotics/ocs2_robotic_assets.git
# Navigate to the directory of ocs2
# Do not forget to change <...> parts
cd <directory_to_ws>/<catkin_ws_name>/src/ocs2
rm -rf ocs2_mpcnet
rm -rf ocs2_raisim
# Navigate to the directory of src
cd <directory_to_ws>/<catkin_ws_name>/src
# Build it
catkin build ocs2
# Source it
source <directory_to_ws>/<catkin_ws_name>/devel/setup.bash
# run tests
catkin run_tests ocs2
The command source would load a configuration file for the bash. Note that each time you open a
new terminal for running your code in your ROS workspace, you need to source the corresponding bash
file in that workspace.
If you encounter the "C++: fatal error: Killed signal terminated program cc1plus" error in this
step, you can solve this issue by creating a swap partition as follows:
# Create partition paths.
sudo mkdir -p /var/cache/swap/
# Set the partition size.
# bs=64M is the block size, count=64 is the number of blocks,
# so the swap space size is bs*count=4096MB=4GB.
sudo dd if=/dev/zero of=/var/cache/swap/swap0 bs=64M count=64
# Set the directory permissions.
sudo chmod 0600 /var/cache/swap/swap0
# create SWAP file.
sudo mkswap /var/cache/swap/swap0
# Activate the SWAP file.
sudo swapon /var/cache/swap/swap0
# Check whether the SWAP information is correct.
sudo swapon -s
<!-- 5. Build the example for legged robots:
# Navigate to the directory of src
cd <directory_to_ws>/<catkin_ws_name>/src
catkin build ocs2_legged_robot_ros
``` -->
5. Run the example for legged robots:
``` bash
# Source workspace
# Do not forget to change <...> parts
source <directory_to_ws>/<catkin_ws_name>/devel/setup.bash
# Launch the example for SQP
roslaunch ocs2_legged_robot_ros legged_robot_sqp.launch
roslaunch is a command-line tool in the Robot Operating System (ROS) that allows users to start and
manage multiple ROS nodes and their configurations using a launch file. It simplifies the process of
initializing complex robotic systems, making it easy to run and manage multiple nodes with their
corresponding parameters and configurations in a coordinated manner.
The above launch file is placed in
<directory_to_ws>/<catkin_ws_name>/src/ocs2/ocs2_robotic_examples/ocs2_legged_robot_
ros/launch/legged_robot_sqp.launch , which launches the corresponding software packages such
as MPC controller, gait scheduler and visualization.
And then, you can see a legged robot in the RViz window:
RViz, short for "ROS Visualization," is a 3D visualization tool for the Robot Operating System (ROS). It
provides a user-friendly interface to display sensor data, robot model representations, and other
relevant information in a 3D environment. RViz allows users to better understand the data collected by a
robot and offers a way to visualize the robot's state, movements, and interactions with its environment.
You should also see new terminal windows appear after you run the above roslaunch command.
One terminal is for specifying the gait type, please type trot in this terminal. Another terminal is
for specifying the destination for the robot to move to, please type 2 0 0 0 in this terminal.
Please record a video for your result to be submitted. In this way, you can get 60% points for this
homework. Feel free to play with this example by trying to enter any displacements and gaits in
the terminals. You can also explore the codebase if you are interested.
Design new gaits
You can simply modify
<directory_to_ws>/<catkin_ws_name>/src/ocs2/ocs2_robotic_examples/ocs2_legged_robot/
config/command/gait.info to design two new gaits for the quadruped robot.
When executing the trot gait, the quadruped robot's four feet will switch between the following
two patterns:
LF_RH: The left front (LF) and right hind (RH) feet are on the ground simultaneously, while the
right front and left hind feet are not.
RF_LH: The right front (RF) and left hind (LH) feet are on the ground simultaneously, while the
left front and right hind feet are not.
You need to now design two new gaits, galloping and jumping, each also switches between two
patterns, but the patterns are different from that of the trot gait.
For galloping, the two patterns are:
The left front and right front feet are on the ground simultaneously, while the left hind and
right hind feet are not.
The left hind and right hind feet are on the ground simultaneously, while the left front and
right front feet are not.
For jumping, the two patterns are:
All four feet are on the ground simultaneously, which is a stance pattern.
All four feet are in the air simultaneously, which is a fly pattern.
To complete it, you need to modify part 1 in the figure below and add some code similar to part 2.
Now, you are done with this assignment! Please remember to record the resulting video! Each gait
will constitute a 20% score.
Submit your homework
You need to pack the following four files into a zip file.
gait.info : the file you modified.
trot.mp4/.mpg : the video describes the result of running the example ( roslaunch
ocs2_legged_robot_ros legged_robot_sqp.launch ) with the built-in trot gait.
gallop.mp4/.mpg : the video to show the quadrupedal robot can do the galloping.
jumping.mp4/.mpg : the video to show the quadrupedal robot can do the jumping.
Note the videos should be in mp4 or mpg format. Then please name your zip file with your
student ID and submit it through Web Learning.
请加QQ:99515681 邮箱:99515681@qq.com WX:codinghelp
- WhatsApp群发营销工具,ws协议号利器/ws劫持号功能/ws拉群秘籍
- 国家重点研发计划“儿童罕见病诊断关键技术与治疗靶点发现及转化医学研究”项目启动
- ins博主人气群发营销助手,instagram电商推广引流管家
- 未知商务维度 WhatsApp拉群工具如何在科技魔法的引导下 让用户感受到业务体验的新奇与惊艳
- 外贸探险家:WhatsApp拉群工具,我这个小白的外贸探险之旅
- 2024上海暖通舒适系统展即将开幕,“暖通人”的行业年中盛会!
- Ins/Instagram营销引流群发之王,ins一键爆粉引流利器震撼登场!
- 中国抗体SM17治疗特应性皮炎(AD)之临床前结果刊登于国际科学期刊《Allergy》
- Instagram自动私信群发软件,ins博主推广神器,ig自动采集
- 确立两大厨电解决方案,华帝发布多款创新性“三好”新品
- Instagram群发助手 - ins定位采集/ig私信博主/ins批量养号/ig私信助手
- Instagram采集指定地区用户,ins接粉软件,ig打粉软件
- COMP2011代写、C++编程设计代做
- CS 211代做、c/c++编程设计代写
- WhatsApp拉群平台,ws云控注册软件/ws混合协议号/ws筛选器
- Instagram引流推广软件攻略,Ins全自动采集软件火热上线!
- 我曾陷入Zalo营销的迷失,直到遇到这个Zalo筛选器工具,找到了回家的路
- Instagram营销私信软件,ins全球粉丝采集工具,ig博主引流软件
- program代做、代写python设计编程
- WhatsApp群发/ws劫持号/ws协议号/ws拉群/WS全业务咨询
- 林永健、武大靖探班中国体育彩票开奖现场 为公众答疑解惑
- Instagram营销群发软件,Ins一键群发工具,助你实现营销梦想!
- Instagram引流神器 - ins采集软件/ig采集助手/ins群发助手/惊喜来袭
- Instagram营销软件,ins定位采集工具/采集全球任意国家
- WhatsApp源头机房出售协议号,ws群发必备工具推荐
- Ig引流软件,Instagram批量群发私信助手,ig引流必备工具
- WhatsApp协议号的用处,ws群发教程/ws拉群工具/ws筛选注册助手
- 低封控软件推荐!Instagram自动私信营销助手,Ins引流轻松搞定!
- 守护食品安全,万店掌AI巡店系统助力门店防线升级!
- Instagram群发筛选营销软件,Ins群发注册工具,一键助你轻松推广!
推荐
- 丰田章男称未来依然需要内燃机 已经启动电动机新项目 尽管电动车在全球范围内持续崛起,但丰田章男 科技
- B站更新决策机构名单:共有 29 名掌权管理者,包括陈睿、徐逸、李旎、樊欣等人 1 月 15 日消息,据界面新闻,B站上周发布内部 科技
- 老杨第一次再度抓握住一瓶水,他由此产生了新的憧憬 瘫痪十四年后,老杨第一次再度抓握住一瓶水,他 科技
- 智慧驱动 共创未来| 东芝硬盘创新数据存储技术 为期三天的第五届中国(昆明)南亚社会公共安 科技
- 疫情期间 这个品牌实现了疯狂扩张 记得第一次喝瑞幸,还是2017年底去北京出差的 科技
- 升级的脉脉,正在以招聘业务铺开商业化版图 长久以来,求职信息流不对称、单向的信息传递 科技
- 全力打造中国“创业之都”名片,第十届中国创业者大会将在郑州召开 北京创业科创科技中心主办的第十届中国创业 科技
- 如何经营一家好企业,需要具备什么要素特点 我们大多数人刚开始创办一家企业都遇到经营 科技
- 创意驱动增长,Adobe护城河够深吗? Adobe通过其Creative Cloud订阅捆绑包具有 科技
- 苹果罕见大降价,华为的压力给到了? 1、苹果官网罕见大降价冲上热搜。原因是苹 科技