# Spot Micro Quadruped Project
![Spot Micro Walking](assets/spot_micro_walking.gif)
![RVIZ](assets/rviz_animation.gif)
![slam](assets/spot_micro_slam.gif)
Video of robot: https://www.youtube.com/watch?v=S-uzWG9Z-5E
* [Overview](#Overview)
* [General Instructions](#general-instructions)
* [Description of ROS Nodes](#description-of-ros-nodes)
* [Additional Project Components](#additional-project-components)
* [URDF](#urdf-model)
* [TF2 Publishing and Odometry](#tf2-publishing-and-odometry)
* [SLAM](#slam)
* [Future Work](#future-work)
* [External Links](#external-links)
## Overview
This project is the source code for a Spot Micro quadruped, a 4 legged open source robot. This code implements motion control of a 3d printed spot micro robot, including sit, stand, angle and walk control. Supporting libraries provide additional capabilities, such as mapping through SLAM and a body mounted lidar. The software is implemented on a Raspberry Pi 3B running Ubuntu 16.04 with ROS Kinetic installed.
The software is composed of C++ and Python nodes in a ROS framework.
#### Hardware:
The frame utilized is the Thingverse Spot Micro frame developed by KDY0523. See [the thingverse page](https://www.thingiverse.com/thing:3445283) for additional details for assembly hardware. The files for cls6336hv servos were printed which also fit the hv5523mg servos I used.
Component List:
* Computer: Raspberry Pi 3B
* Servo control board: PCA9685, controlled via i2c
* Servos: 12 x PDI-HV5523MG
* LCD Panel: 16x2 i2c LCD panel (Optional)
* Battery: 2s 4000 mAh Lipo, direct connection to servo board for servo power
* UBEC: HKU5 5V/5A ubec, used as 5v voltage regulator to power raspberry pi, lcd panel, pca9685 control board.
* Lidar: RPLidar A1
* Custom 3d printed parts for mounts and reinforcements
More information about the hardware, including the additional custom 3d printed parts, coordinate system information, and sample hardware installation photos, can be found in the [additional hardware description](docs/additional_hardware_description.md) document.
#### Software:
This repo is structured as a catkin workspace in a ROS Kinetic envivornment on Ubuntu 16.04. The software may not work or compile outside this environment. Raspberry Pi images preloaded with Ubuntu 16.04 and a ROS Kinetic installation can be found via ubiquity robotics. [See ubiquity robotics webpage](https://downloads.ubiquityrobotics.com/) for download, setup, and wifi setup instructions. It is suggested to also install ROS Kinetic on a Ubuntu 16.04 linux installation/dual boot/virtual machine on a PC for development and for running control nodes. Instructions to install ROS kinetic can be found [here](http://wiki.ros.org/kinetic/Installation/Ubuntu).
**NOTE** A SWAP partition of about 1 GB on the RPI's sd card is necessary to increase the virtual memory available beyond the RPI's onboard RAM. In my experience the catkin compilation process uses all the onboard RAM and stalls indefinitely and does not complete without adding a SWAP partition. Example instructions for adding a SWAP partition [can be found here](https://nebl.io/neblio-university/enabling-increasing-raspberry-pi-swap/).
The provided ROS Catkin make build system can be utilized, but I used `catkin tools` instead ([see catkin tools website]((https://catkin-tools.readthedocs.io/en/latest/))). Compilation commands below will be given assuming `catkin tools`. If not using catkin tools on the raspberry pi, the stock `catkin_make` can be used to compile the code via command such as `catkin_make -DCMAKE_BUILD_TYPE=Release` from the home of the catkin workspace.
##### Software Checkout and Setup:
This repo should be checked out to a catkin workspace on the raspberry pi so the directory structure appears as below. If not already available, a catkin workspace can be created or transitioned from a catkin make workspace using catkin tools ([or if using stock ROS tools, see tutorial pages for creating a catkin workspace](http://wiki.ros.org/catkin/Tutorials/create_a_workspace)). If you don't have the pi connected to the internet you could use the catkin commands to create the workspace on another conputer, then copy the files to a RPi over wifi via scp. For example: `scp spotMicro/* ubuntu@10.42.0.1:~/catkin_ws/src/`.
```
catkin_ws/
│
├── src/
│ ├── spot_micro_motion_cmd
│ │ └── ...
│ ├── spot_micro_keyboard_cmd
│ │ └── ...
│ └── ...
```
Note that this repo utilizes two git submodules, which require additional steps to check out. After checking out the main repo, checkout the submodules via:
```
git submodule update --init --recursive
git submodule update --recursive
```
If any git permission errors are encountered, try the following suggestions via [this stackoverflow post](https://stackoverflow.com/questions/8197089/fatal-error-when-updating-submodule-using-git).
Three additional ROS packages may need to be installed for this project to build succesfully. They can be installed via:
```
sudo apt-get install ros-kinetic-joy
sudo apt-get install ros-kinetic-rplidar-ros
sudo apt-get install ros-kinetic-hector-slam
```
Since the same repo is checked out on both a pi and a laptop/PC, you will need to install an i2c library on the laptop/pc for the software to compile correctly. The `i2cpwm_board` node is not run on the laptop/pc, but compilation will look for dependencies for this node. Install the necessary library via:
`sudo apt-get install libi2c-dev`
Configure catkin tools so cmake Release flag is added. This speeds up code execution. Alternatively, if you want to debug through an IDE such as VSCode, use build type Debug so debug symbols are generated:
`catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release`
Compile spot_micro_motion_cmd and i2cpwm_board nodes via catkin tools. The command below will automatically build i2cpwmboard in the process as it is a dependency. E.g.:
`catkin build spot_micro_motion_cmd`
Or just build entire project:
`catkin build`
If you get an error like the below when running on the pi its likely you are missing the libi2c-dev, which may not be installed in the rpi image you download. To fix this, you could install the library on your pi with an `apt-get` command. If you don't have internet on the pi, you can download the file as a debian `.deb` package to your main computer with the right version for ubuntu 16.04 (https://ubuntu.pkgs.org/16.04/ubuntu-universe-amd64/libi2c-dev_3.1.1-1_all.deb.html) and then copy the file via `scp` to the pi (`scp libi2c-dev_3.1.1-1_all.deb ubuntu@10.42.0.1:~/`) and and install it manually (`sudo dpkg -i libi2c-dev_3.1.1-1_all.deb`).
```
ros-i2cpwmboard/CMakeFiles/i2cpwm_board.dir/build.make:62: recipe for target 'ros-i2cpwmboard/CMakeFiles/i2cpwm_board.dir/src/i2cpwm_controller.cpp.o' failed
make[2]: *** [ros-i2cpwmboard/CMakeFiles/i2cpwm_board.dir/src/i2cpwm_controller.cpp.o] Error 1
CMakeFiles/Makefile2:2343: recipe for target 'ros-i2cpwmboard/CMakeFiles/i2cpwm_board.dir/all' failed
```
#### Note on Walking Gaits
The default gait implemented is a 8 phase gait that incorporates body movement which helps maintain balance and stability. An alternate trot gait, where the diagonally opposite legs move simultaneously, can achieve faster walking speeds, but is less stable and requires careful positioning of the robot's center of mass. The trot gait is the one depicted in the animation at the top of this document. See the `spot_micro_motion_cmd` node's config file for information on how to switch to the trot gait. The 8 phase gait can be observed in the linked Youtube video.
## General Instructions
This section attemps to be a full set of instructions to get a spot micro robot calibrated and running with this code.
#### Servo Configuration
Comprehensive instructions for servo installation, calibration, and configuration can be found in [servo_calibration](docs/servo_calibration.md) document.
#### Run
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
dog__【NVIDIA_Jetson_Edge_AI开发者大赛】- (379个子文件)
spot_micro_motion_cmd.cpp 27KB
spot_micro_walk.cpp 11KB
spot_micro_state.cpp 10KB
spot_micro_stand.cpp 3KB
spot_micro_transition_stand.cpp 3KB
spot_micro_transition_idle.cpp 3KB
utils.cpp 2KB
spot_micro_motion_cmd_node.cpp 1KB
spot_micro_idle.cpp 1KB
Datacages_Homeindex.css 8KB
zTreeStyle.css 6KB
game.css 3KB
ProgressBarWars.css 2KB
AlertWindow.css 2KB
photos.css 905B
SpotM2硬件购买清单.docx 2.01MB
Crowdloop.gif 23.06MB
Crowd.gif 18.07MB
spot_micro_walking.gif 7.27MB
walking_and_slam.gif 5.09MB
walk1.gif 799KB
right.gif 586KB
rviz_animation.gif 506KB
left.gif 341KB
up.gif 250KB
walk.gif 243KB
stand.gif 232KB
down.gif 229KB
idle.gif 219KB
spot_micro_slam.gif 92KB
zTreeStandard.gif 5KB
loading.gif 381B
line_conn.gif 45B
.gitignore 1KB
.gitignore 21B
.gitmodules 499B
spot_micro_motion_cmd.h 8KB
spot_micro_state.h 3KB
spot_micro_walk.h 3KB
rate_limited_first_order_filter.h 2KB
command.h 1KB
spot_micro_transition_stand.h 1KB
spot_micro_transition_idle.h 1KB
utils.h 1KB
spot_micro_stand.h 976B
spot_micro_idle.h 622B
index.html 23KB
64659bd6bf9b24c7b2e83b52e51c632e.jpeg 558KB
64659bd6bf9b24c7b2e83b52e51c632e.jpeg 513KB
1e55ca499b109a8f58c59cec6625aa7d.jpeg 417KB
a19aeec65c8fa7fa5cd013690f805bf3.jpeg 403KB
1e55ca499b109a8f58c59cec6625aa7d.jpeg 386KB
a19aeec65c8fa7fa5cd013690f805bf3.jpeg 366KB
359fc1ad313070030813128c69b127fc.jpeg 330KB
359fc1ad313070030813128c69b127fc.jpeg 310KB
64659bd6bf9b24c7b2e83b52e51c632e.jpeg 212KB
64659bd6bf9b24c7b2e83b52e51c632e.jpeg 212KB
a19aeec65c8fa7fa5cd013690f805bf3.jpeg 167KB
a19aeec65c8fa7fa5cd013690f805bf3.jpeg 167KB
86e3ae728b26306a236e1a8555faf9d6.jpeg 165KB
1e55ca499b109a8f58c59cec6625aa7d.jpeg 164KB
1e55ca499b109a8f58c59cec6625aa7d.jpeg 164KB
86e3ae728b26306a236e1a8555faf9d6.jpeg 159KB
359fc1ad313070030813128c69b127fc.jpeg 157KB
359fc1ad313070030813128c69b127fc.jpeg 157KB
b801af663609ed3e3a4c4865d9339148.jpeg 138KB
d9d2d3555ee87a75234beef27a00c857.jpeg 132KB
b801af663609ed3e3a4c4865d9339148.jpeg 131KB
d9d2d3555ee87a75234beef27a00c857.jpeg 117KB
e319a9496abcf98762bcb039ad041695.jpeg 108KB
f4e598c1ad9aae733f02a17c55224ddc.jpeg 104KB
f4e598c1ad9aae733f02a17c55224ddc.jpeg 96KB
df1ec98a7be1bb21a3fbe03b773ce5f9.jpeg 95KB
ed89a410d687e686057929587740cf3d.jpeg 95KB
e319a9496abcf98762bcb039ad041695.jpeg 93KB
ed89a410d687e686057929587740cf3d.jpeg 86KB
df1ec98a7be1bb21a3fbe03b773ce5f9.jpeg 82KB
6f58421a69d5621d284e0617fe9576cd.jpeg 78KB
86e3ae728b26306a236e1a8555faf9d6.jpeg 78KB
86e3ae728b26306a236e1a8555faf9d6.jpeg 78KB
6f58421a69d5621d284e0617fe9576cd.jpeg 70KB
b801af663609ed3e3a4c4865d9339148.jpeg 66KB
b801af663609ed3e3a4c4865d9339148.jpeg 66KB
76a0da085213dce2dc654bfbd03b5c2e.jpeg 57KB
76a0da085213dce2dc654bfbd03b5c2e.jpeg 50KB
d9d2d3555ee87a75234beef27a00c857.jpeg 50KB
d9d2d3555ee87a75234beef27a00c857.jpeg 50KB
1bea7482696f88c633229da7782a3c09.jpeg 50KB
1bea7482696f88c633229da7782a3c09.jpeg 45KB
f4e598c1ad9aae733f02a17c55224ddc.jpeg 45KB
f4e598c1ad9aae733f02a17c55224ddc.jpeg 45KB
df1ec98a7be1bb21a3fbe03b773ce5f9.jpeg 34KB
df1ec98a7be1bb21a3fbe03b773ce5f9.jpeg 34KB
e319a9496abcf98762bcb039ad041695.jpeg 34KB
e319a9496abcf98762bcb039ad041695.jpeg 34KB
ed89a410d687e686057929587740cf3d.jpeg 33KB
ed89a410d687e686057929587740cf3d.jpeg 33KB
6f58421a69d5621d284e0617fe9576cd.jpeg 32KB
6f58421a69d5621d284e0617fe9576cd.jpeg 32KB
76a0da085213dce2dc654bfbd03b5c2e.jpeg 21KB
共 379 条
- 1
- 2
- 3
- 4
资源评论
好家伙VCC
- 粉丝: 2103
- 资源: 9145
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功