Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First commit of horizontal spine generated using yaml
- Loading branch information
1 parent
4a5e516
commit 1b2ff14
Showing
5 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ Project(ultra-spine) | |
subdirs( | ||
VerticalSpine | ||
VerticalSpine_CableCollision | ||
HorizontalSpine | ||
) |
78 changes: 78 additions & 0 deletions
78
src/dev/ultra-spine/HorizontalSpine/AppHorizontalSpine.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright © 2012, United States Government, as represented by the | ||
* Administrator of the National Aeronautics and Space Administration. | ||
* All rights reserved. | ||
* | ||
* The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed | ||
* under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
|
||
/** | ||
* @file AppHorizontalSpine.cpp | ||
* @brief Contains the definition function main() for AppHorizontalSpine | ||
* which builds a horizontal spine structure defined in YAML | ||
* @author Edward Zhu, Andrew Sabelhaus & Lara Janse van Vuuren | ||
* $Id$ | ||
*/ | ||
|
||
// This application | ||
#include "../../../yamlbuilder/TensegrityModel.h" | ||
// This library | ||
#include "core/terrain/tgBoxGround.h" | ||
#include "core/tgModel.h" | ||
#include "core/tgSimulation.h" | ||
#include "core/tgSimViewGraphics.h" | ||
#include "core/tgWorld.h" | ||
// Bullet Physics | ||
#include "LinearMath/btVector3.h" | ||
// The C++ Standard Library | ||
#include <iostream> | ||
|
||
/** | ||
* The entry point. | ||
* @param[in] argc the number of command-line arguments | ||
* @param[in] argv argv[0] is the executable name | ||
* @param[in] argv argv[1] is the path of the YAML encoded structure | ||
* @return 0 | ||
*/ | ||
int main(int argc, char** argv) | ||
{ | ||
// create the ground and world. Specify ground rotation in radians | ||
const double yaw = 0.0; | ||
const double pitch = 0.0; | ||
const double roll = 0.0; | ||
const tgBoxGround::Config groundConfig(btVector3(yaw, pitch, roll)); | ||
// the world will delete this | ||
tgBoxGround* ground = new tgBoxGround(groundConfig); | ||
|
||
const tgWorld::Config config(98.1); // gravity, dm/sec^2 | ||
tgWorld world(config, ground); | ||
|
||
// create the view | ||
const double timestep_physics = 0.001; // seconds | ||
const double timestep_graphics = 1.f/60.f; // seconds | ||
tgSimViewGraphics view(world, timestep_physics, timestep_graphics); | ||
|
||
// create the simulation | ||
tgSimulation simulation(view); | ||
|
||
// create the models with their controllers and add the models to the simulation | ||
TensegrityModel* const myModel = new TensegrityModel(argv[1]); | ||
|
||
// Add the model to the world | ||
simulation.addModel(myModel); | ||
|
||
simulation.run(); | ||
|
||
// teardown is handled by delete | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
link_directories(${LIB_DIR}) | ||
|
||
link_libraries(core | ||
tgcreator | ||
util | ||
sensors | ||
terrain | ||
tgOpenGLSupport | ||
yaml-cpp | ||
Adapters | ||
TensegrityModel) | ||
|
||
# add_library(TensegrityModel | ||
# TensegrityModel.cpp) | ||
|
||
add_executable(AppHorizontalSpine | ||
# TensegrityModel.cpp | ||
AppHorizontalSpine.cpp) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
substructures: | ||
t1/t2/t3/t4/t5/t6: | ||
path: ./Tetrahedron.yaml | ||
offset: [0, 0 , -12] | ||
|
||
bond_groups: | ||
string: | ||
t1/t2/t3/t4/t5/t6/node_node: | ||
- [front, front] | ||
- [right, right] | ||
- [back, back] | ||
- [left, left] | ||
- [right, front] | ||
- [right, left] | ||
- [back, front] | ||
- [back, left] | ||
|
||
builders: | ||
string: | ||
class: tgBasicActuatorInfo | ||
parameters: | ||
stiffness: 1000.0 | ||
damping: 10.0 | ||
pretension: 0.0 | ||
history: 1 | ||
max_tension: 7000.0 | ||
target_velocity: 12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
nodes: | ||
center: [0, 10, 0] | ||
front: [10, 20, 10] | ||
right: [10, 0, -10] | ||
back: [-10, 20, -10] | ||
left: [-10, 0,10] | ||
|
||
pair_groups: | ||
rod: | ||
- [center, front] | ||
- [center, right] | ||
- [center, back] | ||
- [center, left] | ||
|
||
builders: | ||
rod: | ||
class: tgRodInfo | ||
parameters: | ||
density: 0.014 | ||
radius: 0.5 |