Skip to content

Commit

Permalink
pendulum gmes edition.
Browse files Browse the repository at this point in the history
  • Loading branch information
ku3i committed Feb 14, 2020
1 parent db3bf32 commit fbd9755
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/build/bioloid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ void Bioloid::create_robot(Robot& robot, int index_number, std::vector<double> p
case 94: Robots::Standard ::create_rotor_axial (robot); break;

case 95: Robots::Standard ::create_pendulum (robot, false); break;
case 96: Robots::Standard ::create_pendulum_gmes_ed(robot); break;

default:
dsError("Wrong robot index number (%d)!\n", index_number);
Expand Down
30 changes: 30 additions & 0 deletions src/robots/standard.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,36 @@ create_rotor_axial(Robot& robot)
}


void
create_pendulum_gmes_ed(Robot& robot)
{
const Vector3 base (.5, .5, 1.0);
const Vector3 lever(.025, .025, .9);

dsPrint("PENDULUM GMES Edition\n");
Vector3 pos;

/* body */
pos.x = .0;
pos.y = 0.5*base.y;
pos.z = 0.5*base.z + zheight_start;

robot.create_box("base", pos, base, .0, constants::materials::heavy, colors::white, true, constants::friction::hi);

/* arm */
pos.y = -0.5*lever.y - joint_distance;
pos.z = 0.95*base.z - 0.5 * lever.z + zheight_start;

robot.create_box("lever", pos, lever, .0, constants::materials::heavy, colors::black, false, constants::friction::lo);

/* connect joints */
robot.connect_joint("base" , "lever", .0, .0, +0.5*lever.z - 0.5*lever.x, 'y', -180, +180, 0, JointType::normal, "joint0", "", 5);

/* camera */
robot.set_camera_center_on("base");
robot.setup_camera(Vector3(0.0, -1.2, .60), 90, 0, 0);
}

}} // namespace Robots::Standard

#endif // STANDARD_H_INCLUDED

0 comments on commit fbd9755

Please sign in to comment.