-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jemin Hwangbo
committed
Aug 29, 2022
1 parent
08d4af4
commit e90e1c6
Showing
194 changed files
with
1,280 additions
and
2,304 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
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
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 @@ | ||
This folder contains examples of supported maps by RaisimUnreal. |
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,56 @@ | ||
// This file is part of RaiSim. You must obtain a valid license from RaiSim Tech | ||
// Inc. prior to usage. | ||
|
||
#include "raisim/RaisimServer.hpp" | ||
#include "raisim/World.hpp" | ||
#if WIN32 | ||
#include <timeapi.h> | ||
#endif | ||
|
||
int main(int argc, char* argv[]) { | ||
auto binaryPath = raisim::Path::setFromArgv(argv[0]); | ||
raisim::World::setActivationKey(binaryPath.getDirectory() + "\\rsc\\activation.raisim"); | ||
#if WIN32 | ||
timeBeginPeriod(1); // for sleep_for function. windows default clock speed is 1/64 second. This sets it to 1ms. | ||
#endif | ||
|
||
/// create raisim world | ||
raisim::World world; | ||
world.setTimeStep(0.001); | ||
|
||
/// create objects | ||
auto heightmap = world.addHeightMap(binaryPath.getDirectory() + "\\rsc\\raisimUnrealMaps\\mountain1.png", | ||
0, 0, 151.2, 151.2, 15.3/(39142-32640), -32640 * 15.3/(39142-32640)); | ||
heightmap->setAppearance("hidden"); | ||
auto aliengo = world.addArticulatedSystem(binaryPath.getDirectory() + "\\rsc\\aliengo\\aliengo.urdf"); | ||
|
||
/// aliengo joint PD controller | ||
Eigen::VectorXd jointNominalConfig(aliengo->getGeneralizedCoordinateDim()), jointVelocityTarget(aliengo->getDOF()); | ||
jointNominalConfig << 0, 0, 1.24, 1.0, 0.0, 0.0, 0.0, 0.03, 0.4, -0.8, -0.03, 0.4, -0.8, 0.03, -0.4, 0.8, -0.03, -0.4, 0.8; | ||
jointVelocityTarget.setZero(); | ||
|
||
Eigen::VectorXd jointPgain(aliengo->getDOF()), jointDgain(aliengo->getDOF()); | ||
jointPgain.tail(12).setConstant(100.0); | ||
jointDgain.tail(12).setConstant(1.0); | ||
|
||
aliengo->setGeneralizedCoordinate(jointNominalConfig); | ||
aliengo->setGeneralizedForce(Eigen::VectorXd::Zero(aliengo->getDOF())); | ||
aliengo->setPdGains(jointPgain, jointDgain); | ||
aliengo->setPdTarget(jointNominalConfig, jointVelocityTarget); | ||
aliengo->setName("aliengo"); | ||
|
||
/// launch raisim server | ||
raisim::RaisimServer server(&world); | ||
server.setMap("mountain1"); | ||
server.focusOn(aliengo); | ||
server.launchServer(); | ||
|
||
for (int i=0; i<2000000; i++) { | ||
std::this_thread::sleep_for(std::chrono::microseconds(1000)); | ||
server.integrateWorldThreadSafe(); | ||
} | ||
|
||
std::cout<<"mass "<<aliengo->getMassMatrix()[0]<<std::endl; | ||
|
||
server.killServer(); | ||
} |
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,58 @@ | ||
// This file is part of RaiSim. You must obtain a valid license from RaiSim Tech | ||
// Inc. prior to usage. | ||
|
||
#include "raisim/RaisimServer.hpp" | ||
#include "raisim/World.hpp" | ||
#if WIN32 | ||
#include <timeapi.h> | ||
#endif | ||
|
||
int main(int argc, char* argv[]) { | ||
auto binaryPath = raisim::Path::setFromArgv(argv[0]); | ||
raisim::World::setActivationKey(binaryPath.getDirectory() + "\\rsc\\activation.raisim"); | ||
#if WIN32 | ||
timeBeginPeriod(1); // for sleep_for function. windows default clock speed is 1/64 second. This sets it to 1ms. | ||
#endif | ||
|
||
/// create raisim world | ||
raisim::World world(binaryPath.getDirectory() + "\\rsc\\raisimUnrealMaps\\office1.xml"); | ||
world.setTimeStep(0.001); | ||
|
||
|
||
/// create objects | ||
auto ground = world.addGround(0.02); | ||
ground->setAppearance("hidden"); | ||
auto ball = world.addSphere(0.3, 2.0); | ||
ball->setPosition(raisim::Vec<3>{0,0,2}); | ||
ball->setLinearVelocity(raisim::Vec<3>{1,1,0}); | ||
|
||
auto aliengo = world.addArticulatedSystem(binaryPath.getDirectory() + "\\rsc\\aliengo\\aliengo.urdf"); | ||
|
||
/// aliengo joint PD controller | ||
Eigen::VectorXd jointNominalConfig(aliengo->getGeneralizedCoordinateDim()), jointVelocityTarget(aliengo->getDOF()); | ||
jointNominalConfig << 0, 0, 1.24, 1.0, 0.0, 0.0, 0.0, 0.03, 0.4, -0.8, -0.03, 0.4, -0.8, 0.03, -0.4, 0.8, -0.03, -0.4, 0.8; | ||
jointVelocityTarget.setZero(); | ||
|
||
Eigen::VectorXd jointPgain(aliengo->getDOF()), jointDgain(aliengo->getDOF()); | ||
jointPgain.tail(12).setConstant(100.0); | ||
jointDgain.tail(12).setConstant(1.0); | ||
|
||
aliengo->setGeneralizedCoordinate(jointNominalConfig); | ||
aliengo->setGeneralizedForce(Eigen::VectorXd::Zero(aliengo->getDOF())); | ||
aliengo->setPdGains(jointPgain, jointDgain); | ||
aliengo->setPdTarget(jointNominalConfig, jointVelocityTarget); | ||
aliengo->setName("aliengo"); | ||
|
||
/// launch raisim server | ||
raisim::RaisimServer server(&world); | ||
server.setMap("office1"); | ||
server.focusOn(aliengo); | ||
server.launchServer(); | ||
|
||
for (int i=0; i<2000000; i++) { | ||
std::this_thread::sleep_for(std::chrono::microseconds(20)); | ||
server.integrateWorldThreadSafe(); | ||
} | ||
|
||
server.killServer(); | ||
} |
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
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
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
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
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
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
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
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.