Skip to content

Commit 3c41d16

Browse files
committed
update
1 parent 2ddc755 commit 3c41d16

File tree

99 files changed

+727
-10054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+727
-10054
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CMakeLists.txt.user
2+
CMakeCache.txt
3+
CMakeFiles
4+
CMakeScripts
5+
Testing
6+
Makefile
7+
cmake_install.cmake
8+
install_manifest.txt
9+
compile_commands.json
10+
CTestTestfile.cmake
11+
build/
12+
install/
13+
log/
14+
_deps

.vscode/settings.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"files.associations": {
3+
"ostream": "cpp",
4+
"iostream": "cpp",
5+
"iosfwd": "cpp",
6+
"cctype": "cpp",
7+
"clocale": "cpp",
8+
"cmath": "cpp",
9+
"csignal": "cpp",
10+
"cstdarg": "cpp",
11+
"cstddef": "cpp",
12+
"cstdio": "cpp",
13+
"cstdlib": "cpp",
14+
"cstring": "cpp",
15+
"ctime": "cpp",
16+
"cwchar": "cpp",
17+
"cwctype": "cpp",
18+
"array": "cpp",
19+
"atomic": "cpp",
20+
"strstream": "cpp",
21+
"bit": "cpp",
22+
"*.tcc": "cpp",
23+
"bitset": "cpp",
24+
"cfenv": "cpp",
25+
"chrono": "cpp",
26+
"compare": "cpp",
27+
"complex": "cpp",
28+
"concepts": "cpp",
29+
"condition_variable": "cpp",
30+
"cstdint": "cpp",
31+
"deque": "cpp",
32+
"forward_list": "cpp",
33+
"list": "cpp",
34+
"map": "cpp",
35+
"set": "cpp",
36+
"string": "cpp",
37+
"unordered_map": "cpp",
38+
"unordered_set": "cpp",
39+
"vector": "cpp",
40+
"exception": "cpp",
41+
"algorithm": "cpp",
42+
"functional": "cpp",
43+
"iterator": "cpp",
44+
"memory": "cpp",
45+
"memory_resource": "cpp",
46+
"numeric": "cpp",
47+
"optional": "cpp",
48+
"random": "cpp",
49+
"ratio": "cpp",
50+
"string_view": "cpp",
51+
"system_error": "cpp",
52+
"tuple": "cpp",
53+
"type_traits": "cpp",
54+
"utility": "cpp",
55+
"fstream": "cpp",
56+
"initializer_list": "cpp",
57+
"iomanip": "cpp",
58+
"istream": "cpp",
59+
"limits": "cpp",
60+
"mutex": "cpp",
61+
"new": "cpp",
62+
"numbers": "cpp",
63+
"semaphore": "cpp",
64+
"shared_mutex": "cpp",
65+
"sstream": "cpp",
66+
"stdexcept": "cpp",
67+
"stop_token": "cpp",
68+
"streambuf": "cpp",
69+
"thread": "cpp",
70+
"cinttypes": "cpp",
71+
"typeindex": "cpp",
72+
"typeinfo": "cpp",
73+
"variant": "cpp"
74+
}
75+
}

LICENSE

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
MIT License
1+
BSD 3-Clause License
22

3-
Copyright (c) 2021 NimaPng
3+
Copyright (c) 2022, YANG Shunpeng
4+
All rights reserved.
45

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
118

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
1411

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Poplar/src/LIPM/LIPM_MPC.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void LIPM_MPC::run() {
141141
cin << -_c_lb, _c_ub;
142142
solver_state = eiquadprog_solver.solve_quadprog(_H, _g, Mat(0, _C.cols()), Vec(0), Cin, cin,
143143
_uOptimal);
144-
printf("solver state: %d\n", solver_state);
144+
// printf("solver state: %d\n", solver_state);
145145
if (solver_state != eiquadprog::solvers::EIQUADPROG_FAST_OPTIMAL) {
146146
// throw runtime_error("TaskSpaceControl::solve() qp failed, related data has been saved in qp_failed.txt");
147147
std::cerr << "LIPM_MPC::solve() qp failed" << endl;
@@ -296,7 +296,7 @@ Vec LIPM_MPC::forceDistribute(Poplar::Index ith_horizon, Vec3 pos, Vec3 linear_v
296296
// solver_state = eiquadprog_solver_fd.solve_quadprog(H, g, Ce, -ce, CI, cI, force_optimal);
297297
solver_state = eiquadprog_solver_fd.solve_quadprog(H, g, Mat::Zero(0, 3 * n_dims), Vec::Zero(0), CI, cI,
298298
force_optimal);
299-
printf("solver state: %d\n", solver_state);
299+
// printf("solver state: %d\n", solver_state);
300300
if (solver_state != eiquadprog::solvers::EIQUADPROG_FAST_OPTIMAL) {
301301
throw runtime_error("LIPM_MPC::forceDistribute() qp failed, related data has been saved in qp_failed.txt");
302302
std::cerr << "LIPM_MPC::forceDistribute() qp failed" << endl;

Poplar/src/SRGB_MPC/SRGB_MPC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void SRGB_MPC_IMPL::solve(Scalar t_now) {
220220
cin << -_lb, _ub;
221221
solver_state = eiquadprog_solver.solve_quadprog(_H, _g, Mat(0, 3 * _n_contact), Vec(0), Cin, cin,
222222
_optimalContactForce);
223-
printf("solver state: %d\n", solver_state);
223+
// printf("solver state: %d\n", solver_state);
224224
if (solver_state != eiquadprog::solvers::EIQUADPROG_FAST_OPTIMAL) {
225225
// throw runtime_error("TaskSpaceControl::solve() qp failed, related data has been saved in qp_failed.txt");
226226
std::cerr << "SRGB_MPC::solve() qp failed" << endl;

Poplar/src/TaskSpaceControl/TaskSpaceControl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void TaskSpaceControl::solve() {
176176
cin << -c_lb, c_ub;
177177
ce0 = -ce;
178178
solver_state = eiquadprog_solver.solve_quadprog(H, g, Ce, ce0, Cin, cin, optimal_u);
179-
printf("solver state: %d\n", solver_state);
179+
// printf("solver state: %d\n", solver_state);
180180
if (solver_state != eiquadprog::solvers::EIQUADPROG_FAST_OPTIMAL) {
181181
saveAllData("qp_failed.txt");
182182
throw runtime_error("TaskSpaceControl::solve() qp failed, related data has been saved in qp_failed.txt");

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,45 @@
11
# Digit Simulation and Motion Control
2+
3+
## Introduction
4+
5+
This package provides insight into various algorithms used for motion planning of humanoid robots, such as foothold placement, COM trajectory optimization, and controller design for closed-chain robots. By utilizing this package, users can gain knowledge about these complex algorithms and their implementation.
6+
7+
<div align="center">
8+
<img src="./digit.png">
9+
</div>
10+
11+
## Advantage
12+
As far as the author is aware, this package represents the first opens-source complete solution for motion planning and control of humanoid robot with closed chains. It is hoped that this package will be useful to those looking to learn about motion planning and control algorithms. Please note that some of the algorithms included in this package have not yet been published and are subject to copyright protection. (Note: forward veolocity beyond **4.0m/s** in simulator [MuJoCo](https://mujoco.org/))
13+
14+
https://drive.google.com/file/d/1cLD83HytvqX6r0aE3TzPF23wfX0IMfzw/view?usp=sharing
15+
16+
### clone this project
17+
18+
```
19+
# Open a new terminal
20+
git clone https://github.com/pianist1234567i/Digit.git
21+
```
22+
23+
### Build this pakcage
24+
```
25+
cd Digit & mkdir build
26+
```
27+
28+
```
29+
cd build & cmake ..
30+
```
31+
32+
```
33+
make -j4
34+
```
35+
36+
### Run package
37+
```
38+
sh ../run.sh
39+
```
40+
41+
# Reference
42+
43+
[1] Yang, Shunpeng, et al. "Improved Task Space Locomotion Controller for a Quadruped Robot with Parallel Mechanisms." 2022 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2022.
44+
45+
[2] Featherstone, Roy. Rigid body dynamics algorithms. Springer, 2014.

Simulation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ include_directories(include)
1010

1111
link_directories(${THIS_COM}/Simulation/lib/)
1212

13-
target_link_libraries(MuJoCoSim mujoco210 GL glew glfw rt pthread lcm)
13+
target_link_libraries(MuJoCoSim mujoco210 GL glew glfw rt pthread)
-289 KB
Binary file not shown.

Simulation/lib/meshes_new/arm-L1.stl

-602 KB
Binary file not shown.

Simulation/lib/meshes_new/arm-L2.stl

-1.25 MB
Binary file not shown.

Simulation/lib/meshes_new/arm-L3.stl

-731 KB
Binary file not shown.

Simulation/lib/meshes_new/arm-L4.stl

-478 KB
Binary file not shown.
-216 KB
Binary file not shown.
-854 KB
Binary file not shown.
-1.25 MB
Binary file not shown.
-1.26 MB
Binary file not shown.
-1.51 MB
Binary file not shown.

Simulation/lib/meshes_new/knee.stl

-1.63 MB
Binary file not shown.
-1.26 MB
Binary file not shown.
-1.26 MB
Binary file not shown.
-1.26 MB
Binary file not shown.
-1.26 MB
Binary file not shown.

Simulation/lib/meshes_new/shin.stl

-1.03 MB
Binary file not shown.
Binary file not shown.

Simulation/lib/meshes_new/tarsus.stl

-1.19 MB
Binary file not shown.
-143 KB
Binary file not shown.
-127 KB
Binary file not shown.
-192 KB
Binary file not shown.
-192 KB
Binary file not shown.
-192 KB
Binary file not shown.
-192 KB
Binary file not shown.
-192 KB
Binary file not shown.
-286 KB
Binary file not shown.
-1.76 MB
Binary file not shown.

Simulation/lib/meshes_new/torso.stl

-1.88 MB
Binary file not shown.

0 commit comments

Comments
 (0)