本文整理了Java中us.ihmc.simulationconstructionset.Robot.setController
方法的一些代码示例,展示了Robot.setController
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Robot.setController
方法的具体详情如下:
包路径:us.ihmc.simulationconstructionset.Robot
类名称:Robot
方法名:setController
暂无
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
@Override
public void createAndSetContactControllerToARobot()
{
ContactController contactController = new ContactController();
contactController.setContactParameters(100000.0, 100.0, 0.5, 0.3);
contactController.addContactPoints(contactPoints);
for (Robot r : contactableRobots)
{
if (r instanceof Contactable)
contactController.addContactable((Contactable) r);
}
if (contactableRobots.size() > 0)
contactableRobots.get(0).setController(contactController);
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
@Override
public void createAndSetContactControllerToARobot()
{
ContactController contactController = new ContactController();
contactController.setContactParameters(100000.0, 100.0, 0.5, 0.3);
contactController.addContactPoints(contactPoints);
for (Robot r : contactableRobots)
{
if (r instanceof Contactable)
contactController.addContactable((Contactable) r);
}
if (contactableRobots.size() > 0)
contactableRobots.get(0).setController(contactController);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
private SimulationConstructionSet constructRewindableSimulationConstructionSet()
{
Robot robot = new Robot("Test");
RobotController controller = new RewindableController(robot);
robot.setController(controller);
return constructSimulationConstructionSet(robot, controller);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
private SimulationConstructionSet constructDifficultToDetectNonRewindableSimulationConstructionSet()
{
Robot robot = new Robot("Test");
RobotController controller = new DifficultToDetectNonRewindableController(robot);
robot.setController(controller);
return constructSimulationConstructionSet(robot, controller);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
@Override
public void createAndSetContactControllerToARobot()
{
ContactController contactController = new ContactController();
contactController.setContactParameters(100000.0, 100.0, 0.5, 0.3);
contactController.addContactPoints(contactPoints);
for (Robot r : contactableRobots)
{
if (r instanceof Contactable)
contactController.addContactable((Contactable) r);
}
if (contactableRobots.size() > 0)
contactableRobots.get(0).setController(contactController);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
private SimulationConstructionSet constructEasilyDetectableNonRewindableSimulationConstructionSet()
{
Robot robot = new Robot("Test");
RobotController controller = new EasilyDetectableNonRewindableController(robot);
robot.setController(controller);
return constructSimulationConstructionSet(robot, controller);
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
@Override
public void createAndSetContactControllerToARobot()
{
ContactController contactController = new ContactController();
contactController.setContactParameters(10000.0, 1000.0, 0.5, 0.3);
contactController.addContactPoints(contactPoints);
contactController.addContactables(contactables);
envRobots.get(0).setController(contactController);
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
@Override
public void createAndSetContactControllerToARobot()
{
// add contact controller to any robot so it gets called
ContactController contactController = new ContactController();
contactController.setContactParameters(10000.0, 1000.0, 0.5, 0.3);
contactController.addContactPoints(contactPoints);
contactController.addContactables(contactables);
environmentRobots.get(0).setController(contactController);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
@ContinuousIntegrationAnnotations.ContinuousIntegrationTest(estimatedDuration = 11.3)
@Test(timeout=3000000)
public void testLinearAndAngularMomentumAreConverved()
{
int numberOfRobotsToTest = 5;
int minNumberOfAxes = 2;
int maxNumberOfAxes = 10;
Robot[] robots = new Robot[numberOfRobotsToTest];
for (int i = 0; i < numberOfRobotsToTest; i++)
{
Robot robot = new RobotTools.SCSRobotFromInverseDynamicsRobotModel("robot" + i, getRandomFloatingChain(minNumberOfAxes, maxNumberOfAxes).getRootJoint());
robot.setGravity(0.0, 0.0, 0.0);
robot.setController(new ConservedQuantitiesChecker(robot));
robot.setController(new SinusoidalTorqueController(robot));
robots[i] = robot;
}
SimulationConstructionSet scs = new SimulationConstructionSet(robots, simulationTestingParameters);
scs.startOnAThread();
BlockingSimulationRunner blockingSimulationRunner = new BlockingSimulationRunner(scs, 30.0);
try
{
blockingSimulationRunner.simulateAndBlock(8.0);
}
catch(BlockingSimulationRunner.SimulationExceededMaximumTimeException | ControllerFailureException e)
{
e.printStackTrace();
fail();
}
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public DRCSimulationVisualizer(Robot robot, YoGraphicsListRegistry yoGraphicsListRegistry)
{
this.robot = robot;
YoGraphicsList yoGraphicsList = new YoGraphicsList("Simulation Viz");
ArrayList<GroundContactPoint> groundContactPoints = robot.getAllGroundContactPoints();
AppearanceDefinition appearance = YoAppearance.Red(); // BlackMetalMaterial();
for (GroundContactPoint groundContactPoint : groundContactPoints)
{
double scaleFactor = 0.0015;
YoGraphicVector dynamicGraphicVector = new YoGraphicVector(groundContactPoint.getName(), groundContactPoint.getYoPosition(), groundContactPoint.getYoForce(), scaleFactor, appearance);
yoGraphicsList.add(dynamicGraphicVector);
}
if (yoGraphicsListRegistry != null)
yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
robot.setController(this, 10);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
private void createContactPoints(Robot floatingRobot)
{
GroundContactPoint contactPoint1 = new GroundContactPoint("contactPoint1", new Vector3D(0.0, 0.0, 0.0), floatingRobot);
verticalJoint.addGroundContactPoint(1, contactPoint1);
GroundContactPoint contactPoint2 = new GroundContactPoint("contactPoint2", new Vector3D(-0.002, 0.0, 0.0), floatingRobot);
verticalJoint.addGroundContactPoint(1, contactPoint2);
GroundContactPoint contactPoint3 = new GroundContactPoint("contactPoint3", new Vector3D(0.002, 0.0, 0.0), floatingRobot);
verticalJoint.addGroundContactPoint(1, contactPoint3);
ContactController contactController = new ContactController();
contactController.setContactParameters(10000.0, 1000.0, 0.5, 0.3);
contactController.addContactPoints(robots[0].getAllGroundContactPoints());
ArrayList<Contactable> robotList = new ArrayList<Contactable>();
robotList.add((Contactable) robots[1]);
contactController.addContactables(robotList);
robots[1].setController(contactController);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
@ContinuousIntegrationTest(estimatedDuration = 0.6)
@Test(timeout = 30000)
public void testTwoRewindableSimulationsWithAScript() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException, UnreasonableAccelerationException
{
Robot robot0 = createSimpleRobot();
RobotController rewindableController0 = new RewindableOrNotRewindableController(true);
robot0.setController(rewindableController0);
SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters();
parameters.setCreateGUI(false);
parameters.setDataBufferSize(100);
SimulationConstructionSet scs0 = new SimulationConstructionSet(robot0, parameters);
scs0.setDT(0.0001, 11);
scs0.startOnAThread();
Robot robot1 = createSimpleRobot();
RobotController rewindableController1 = new RewindableOrNotRewindableController(true);
robot1.setController(rewindableController1);
SimulationConstructionSet scs1 = new SimulationConstructionSet(robot1, parameters);
scs1.setDT(0.0001, 11);
scs1.startOnAThread();
int nTicksInitial = 121;
int nTicksCompare = 121;
int nTicksFinal = 11;
SimulationComparisonScript script = new SimpleRewindabilityComparisonScript(nTicksInitial, nTicksCompare, nTicksFinal);
ReflectionSimulationComparer.compareTwoSimulations(scs0, scs1, script, true, true);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
@ContinuousIntegrationTest(estimatedDuration = 0.5)
@Test(timeout = 30000)
public void testTwoNonRewindableSimulationsWithAScript() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException, UnreasonableAccelerationException
{
Robot robot0 = new Robot("robot");
RobotController rewindableController0 = new RewindableOrNotRewindableController(false);
robot0.setController(rewindableController0);
SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters();
parameters.setCreateGUI(false);
parameters.setDataBufferSize(100);
SimulationConstructionSet scs0 = new SimulationConstructionSet(robot0, parameters);
scs0.setDT(0.0001, 10);
scs0.startOnAThread();
Robot robot1 = new Robot("robot");
RobotController rewindableController1 = new RewindableOrNotRewindableController(false);
robot1.setController(rewindableController1);
SimulationConstructionSet scs1 = new SimulationConstructionSet(robot1, parameters);
scs1.setDT(0.0001, 10);
scs1.startOnAThread();
int nTicksInitial = 20;
int nTicksCompare = 30;
int nTicksFinal = 40;
SimulationComparisonScript script = new SimpleRewindabilityComparisonScript(nTicksInitial, nTicksCompare, nTicksFinal);
ReflectionSimulationComparer.compareTwoSimulations(scs0, scs1, script, false, true);
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
robot.setController(toolboxUpdater);
robot.setDynamic(false);
robot.setGravity(0);
代码示例来源:origin: us.ihmc/ihmc-footstep-planning-test
dummy.setController(new Controller(graphicsListRegistry));
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
robot.setController(this);
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
private void createFloatingRobot()
{
Robot floatingRobot = new Robot("floatingRobot");
Vector3D position = new Vector3D(0.0, 0.02, 1.1);
double length = 0.01;
floatingRobot.setGravity(0.0, 0.0, 0.0);
horizontalJoint = new SliderJoint("y", position, floatingRobot, Axis.Y);
floatingRobot.addRootJoint(horizontalJoint);
Link linkHorizontal = new Link("linkHorizontal");
linkHorizontal.setMass(0.5);
linkHorizontal.setComOffset(length / 2.0, 0.0, 0.0);
linkHorizontal.setMomentOfInertia(0.0, 0.01, 0.0);
Graphics3DObject linkHorizontalGraphics = new Graphics3DObject();
linkHorizontalGraphics.addCylinder(length * 10, 0.005, YoAppearance.Orange());
linkHorizontal.setLinkGraphics(linkHorizontalGraphics);
horizontalJoint.setLink(linkHorizontal);
verticalJoint = new SliderJoint("z", new Vector3D(0.0, 0.0, 0.0), floatingRobot, Axis.Z);
Link linkVertical = new Link("linkVertical");
linkVertical.setMass(0.5);
linkVertical.setComOffset(length / 2.0, 0.0, 0.0);
linkVertical.setMomentOfInertia(0.0, 0.01, 0.0);
Graphics3DObject linkVerticalGraphics = new Graphics3DObject();
linkVerticalGraphics.addCylinder(length, 0.005, YoAppearance.Blue());
linkVertical.setLinkGraphics(linkVerticalGraphics);
verticalJoint.setLink(linkVertical);
horizontalJoint.addJoint(verticalJoint);
createFloatingRobotController();
robots[0] = floatingRobot;
robots[0].setController(floatingRobotController);
}
代码示例来源:origin: us.ihmc/IHMCSimulationToolkit
rootJoint = new FloatingJoint("floating", new Vector3d(), robot);
robot.getRobotsYoVariableRegistry();
robot.setController(this);
scs.setRobot(robot);
swingLeg.set(RobotQuadrant.FRONT_RIGHT);
代码示例来源:origin: us.ihmc/IHMCSimulationToolkit
rootJoint = new FloatingJoint("floating", new Vector3d(), robot);
robot.getRobotsYoVariableRegistry();
robot.setController(this);
scs = new SimulationConstructionSet();
scs.setRobot(robot);
代码示例来源:origin: us.ihmc/IHMCSimulationToolkit
robot.setController(this);
scs = new SimulationConstructionSet();
scs.setRobot(robot);
内容来源于网络,如有侵权,请联系作者删除!