Skip to content

Commit

Permalink
Merge pull request #309 from jhwangbo/master
Browse files Browse the repository at this point in the history
fixed mesh orientation issue. fixed visual body naming issue
  • Loading branch information
jhwangbo authored Jun 3, 2022
2 parents 7f75e58 + 82bf4f6 commit 5cb1340
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions examples/src/server/visualObjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,27 @@ int main(int argc, char* argv[]) {
/// launch raisim server
raisim::RaisimServer server(&world);
server.launchServer();
raisim::Vec<4> quat = {0.6, 0.2, -0.6, 0.1};
quat = quat / quat.norm();
raisim::Mat<3, 3> inertia;
inertia.setIdentity();
const raisim::Vec<3> com = {0, 0, 0};

auto visSphere = server.addVisualSphere("v_sphere", 1.0, 1, 1, 1, 1);
auto visBox = server.addVisualBox("v_box", 1, 1, 1, 1, 1, 1, 1);
auto visCylinder = server.addVisualCylinder("v_cylinder", 1, 1, 0, 1, 0, 1);
auto visCapsule = server.addVisualCapsule("v_capsule", 1, 0.5, 0, 0, 1, 1);
auto visMesh = server.addVisualMesh("v_mesh", binaryPath.getDirectory() + "/rsc/a1/meshes/trunk.stl");
auto visCapsule = server.addVisualCapsule("Cylinder", 1, 0.5, 0, 0, 1, 1);
auto mesh = world.addMesh(binaryPath.getDirectory() + "/rsc/monkey/monkey.obj", 1, inertia, com);
auto visMesh = server.addVisualMesh("v_mesh", binaryPath.getDirectory() + "/rsc/monkey/monkey.obj");
auto anymalB = server.addVisualArticulatedSystem("v_anymal", binaryPath.getDirectory() + "/rsc/anymal/urdf/anymal.urdf");
anymalB->color = {0.5, 0.0, 0.0, 0.5};

mesh->setOrientation(quat);
visMesh->setOrientation(quat.e());
visSphere->setPosition(2,0,0);
visCylinder->setPosition(0,2,0);
visCapsule->setPosition(2,2,0);
visMesh->setPosition(2,-2,1);
mesh->setPosition(2,-2,1.1);
Eigen::VectorXd gc(19);
gc << 0, 0, 3.54, 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;
anymalB->setGeneralizedCoordinate(gc);
Expand Down
Binary file modified raisimUnity/linux/raisimUnity_Data/Managed/Assembly-CSharp.dll
Binary file not shown.
Binary file modified raisimUnity/linux/raisimUnity_Data/globalgamemanagers
Binary file not shown.
Binary file modified raisimUnity/linux/raisimUnity_Data/level0
Binary file not shown.

0 comments on commit 5cb1340

Please sign in to comment.