Simulation Construction Set

Simulation Construction Set

  • IHMC Home
  • All IHMC Docs
  • About IHMC

›Creating Links

Getting Started

  • Quick Start
  • Requirements
  • Using IHMC Open Robotics Software .jar releases with Maven/Gradle
  • Building .jars
  • Depending Directly on the Source

Using the SCS GUI

  • Running a simulation
  • Changing the Camera Settings
  • SCS Variables
  • Graphing Variables
  • Simulation Replay
  • Data Buffer
  • Exporting Data
  • Export Snapshots and Video of the 3D View

Creating a New Simulation

  • Summary
  • Create a New Project
  • SimplePendulumSimulation.java
  • SimplePendulumRobot.java
  • Run the simulation

Adding Control to a Simulation

  • Summary
  • Adding control to a simulation
  • Run the simulation

Creating Links

  • Summary
  • Creating Links
  • Run the Simulation

Creating Robot with Multiple Joints

  • Summary
  • Create a New Package
  • Mobile Simulation
  • Initial Variables in MobileRobot Class
  • MobileRobot Class Description

Ground Contact Modeling

  • Summary
  • Create a New Package
  • Create a New Class FallingBrickSimulation
  • Create a New Class FallingBrickRobot
  • Create a New Class WavyGroundProfile
  • Description and Analysis

Implementing Closed-Chain Mechanisms Using External Force Points

  • Summary
  • Implementing Closed-Chain Mechanisms
  • FlyballGovernorSimulation Class
  • FlyballGovernorRobot Class
  • FlyballGovernorSimpleClosedLoopConstraintController Class
  • FlyballGovernorCommonControlParameters Class
  • Description and Analysis

Run the Simulation

1. Run LinkExampleSimulation.

You should get a view resembling that of the figure below.

 Six example shapes. Coordinate systems are located at the origin of each shape.

2. Modify the values of the parameters of some of the shapes

For example, try modifying the value of the sphere:

private static final double SPHERE_R = 0.15;

Notice how it changes the shape.

Try modifying the other shapes as well and notice how their size and proportions change with each value.

3. Try modifying the space set between each shape relative to each shape.

The origin of each coordinate system is at the origin of each shape.

Try modifying the OFFSET and COORD_LENGTH values.

The parameters passed into translate(OFFSET, 1.0, 0.0) within the exampleShapes() method will change the placement of the shape that calls the translate() method.

4. Add rotations and more translation and notice their effects.

In order to add rotations you have to use the built in linkGraphics.rotate(double rotAng, int rotAxis) method.

Make sure that you import us.ihmc.robotics.Axis in order to use the rotate method.

Try testing this method out on some of your already created shapes. Notice how they are effected.

For more information you can look at the LinkGraphicsDescription API Page.

5. Try creating some shapes with different appearances

To change the appearance of some of the shapes take a look at the YoAppearance Utility API.

6. Try experimenting to make an object, such as a snowman, out of the shapes.

Try to create a snowman that looks like the image below.

 Three Spheres stacked on top of each other with different values set for `SPHERE_R`

Snowman example code

package us.ihmc.exampleSimulations.linkExamples;

import us.ihmc.graphicsDescription.appearance.YoAppearance;
import us.ihmc.robotics.robotDescription.LinkGraphicsDescription;
import us.ihmc.simulationconstructionset.Link;
import us.ihmc.simulationconstructionset.Robot;
import us.ihmc.simulationconstructionset.SimulationConstructionSet;



public class LinkExamplesSimulation
{
   private SimulationConstructionSet sim;

   private static final double SPHERE_R = 0.15;

   private static final double OFFSET = 1.5, COORD_LENGTH = 0.5;


   public LinkExamplesSimulation()
   {
      Robot nullRob = null;
      sim = new SimulationConstructionSet(nullRob);
      // position the camera to view links
      sim.setCameraPosition(10.0, 6.0, 3.0);
      sim.setCameraFix(0.5, 0.5, 0.0);
      Link exampleShapes = exampleShapes();
      sim.addStaticLink(exampleShapes);
      sim.setGroundVisible(false);

      Thread myThread = new Thread(sim);
      myThread.start();
   }


   public static void main(String[] args)
   {
      new LinkExamplesSimulation();
   }


   private Link exampleShapes()
   {
      Link ret = new Link("example shapes");
      LinkGraphicsDescription linkGraphics = new LinkGraphicsDescription();

      // Sphere
      linkGraphics.translate(0.0 * OFFSET, 0.0, 0.0);
      linkGraphics.addCoordinateSystem(COORD_LENGTH);
      linkGraphics.addSphere(SPHERE_R + 0.1, YoAppearance.White());

      linkGraphics.translate(0.0 * OFFSET, 0.0, -0.6);
      linkGraphics.addCoordinateSystem(COORD_LENGTH);
      linkGraphics.addSphere(SPHERE_R + 0.3, YoAppearance.White());

      linkGraphics.translate(0.0 * OFFSET, 0.0, -0.9);
      linkGraphics.addCoordinateSystem(COORD_LENGTH);
      linkGraphics.addSphere(SPHERE_R + 0.55, YoAppearance.White());

      ret.setLinkGraphics(linkGraphics);

      return ret;
   }

}

← Creating LinksSummary →
Simulation Construction Set
Docs
Quick StartSoftware Documentation
Community
GitHubFacebookTwitterYouTube
Copyright © 2018 IHMC Robotics