本文整理汇总了Java中com.qualcomm.robotcore.hardware.HardwareMap.get方法的典型用法代码示例。如果您正苦于以下问题:Java HardwareMap.get方法的具体用法?Java HardwareMap.get怎么用?Java HardwareMap.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.qualcomm.robotcore.hardware.HardwareMap
的用法示例。
在下文中一共展示了HardwareMap.get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: FtcMRRangeSensor
import com.qualcomm.robotcore.hardware.HardwareMap; //导入方法依赖的package包/类
/**
* Constructor: Creates an instance of the object.
*
* @param hardwareMap specifies the global hardware map.
* @param instanceName specifies the instance name.
* @param filters specifies an array of filter objects, one for each axis, to filter sensor data. If no filter
* is used, this can be set to null.
*/
public FtcMRRangeSensor(HardwareMap hardwareMap, String instanceName, TrcFilter[] filters)
{
super(instanceName, 1, filters);
if (debugEnabled)
{
dbgTrace = new TrcDbgTrace(moduleName + "." + instanceName, tracingEnabled, traceLevel, msgLevel);
}
sensor = hardwareMap.get(ModernRoboticsI2cRangeSensor.class, instanceName);
}
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:20,代码来源:FtcMRRangeSensor.java示例2: FtcMRColorSensor
import com.qualcomm.robotcore.hardware.HardwareMap; //导入方法依赖的package包/类
/**
* Constructor: Creates an instance of the object.
*
* @param hardwareMap specifies the global hardware map.
* @param instanceName specifies the instance name.
*/
public FtcMRColorSensor(HardwareMap hardwareMap, String instanceName)
{
super(instanceName, 1);
if (debugEnabled)
{
dbgTrace = new TrcDbgTrace(moduleName + "." + instanceName, tracingEnabled, traceLevel, msgLevel);
}
sensor = hardwareMap.get(ModernRoboticsI2cColorSensor.class, instanceName);
// sensorState = new FtcI2cDeviceState(instanceName, sensor);
}
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:19,代码来源:FtcMRColorSensor.java示例3: FtcDistanceSensor
import com.qualcomm.robotcore.hardware.HardwareMap; //导入方法依赖的package包/类
/**
* Constructor: Creates an instance of the object.
*
* @param hardwareMap specifies the global hardware map.
* @param instanceName specifies the instance name.
*/
public FtcDistanceSensor(HardwareMap hardwareMap, String instanceName)
{
super(instanceName, 1);
if (debugEnabled)
{
dbgTrace = new TrcDbgTrace(moduleName + "." + instanceName, tracingEnabled, traceLevel, msgLevel);
}
sensor = hardwareMap.get(DistanceSensor.class, instanceName);
}
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:18,代码来源:FtcDistanceSensor.java示例4: FtcDigitalInput
import com.qualcomm.robotcore.hardware.HardwareMap; //导入方法依赖的package包/类
/**
* Constructor: Creates an instance of the object.
*
* @param hardwareMap specifies the global hardware map.
* @param instanceName specifies the instance name.
*/
public FtcDigitalInput(HardwareMap hardwareMap, String instanceName)
{
super(instanceName);
if (debugEnabled)
{
dbgTrace = new TrcDbgTrace(moduleName + "." + instanceName, tracingEnabled, traceLevel, msgLevel);
}
digitalInput = hardwareMap.get(DigitalChannel.class, instanceName);
digitalInput.setMode(DigitalChannel.Mode.INPUT);
}
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:19,代码来源:FtcDigitalInput.java示例5: FtcDigitalOutput
import com.qualcomm.robotcore.hardware.HardwareMap; //导入方法依赖的package包/类
/**
* Constructor: Creates an instance of the object.
*
* @param hardwareMap specifies the global hardware map.
* @param instanceName specifies the instance name.
*/
public FtcDigitalOutput(HardwareMap hardwareMap, String instanceName)
{
super(instanceName);
if (debugEnabled)
{
dbgTrace = new TrcDbgTrace(moduleName + "." + instanceName, tracingEnabled, traceLevel, msgLevel);
}
digitalOutput = hardwareMap.get(DigitalChannel.class, instanceName);
digitalOutput.setMode(DigitalChannel.Mode.OUTPUT);
}
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:19,代码来源:FtcDigitalOutput.java示例6: FtcColorSensor
import com.qualcomm.robotcore.hardware.HardwareMap; //导入方法依赖的package包/类
/**
* Constructor: Creates an instance of the object.
*
* @param hardwareMap specifies the global hardware map.
* @param instanceName specifies the instance name.
*/
public FtcColorSensor(HardwareMap hardwareMap, String instanceName)
{
super(instanceName, 1);
if (debugEnabled)
{
dbgTrace = new TrcDbgTrace(moduleName + "." + instanceName, tracingEnabled, traceLevel, msgLevel);
}
sensor = hardwareMap.get(ColorSensor.class, instanceName);
}
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:18,代码来源:FtcColorSensor.java示例7: init
import com.qualcomm.robotcore.hardware.HardwareMap; //导入方法依赖的package包/类
public void init(HardwareMap ahwMap) {
// Initialize base Motor and Servo objects
super.init(ahwMap);
/*
* Matrix controllers are special.
*
* A Matrix controller is one controller with both motors and servos
* but software wants to treat it as two distinct controllers, one
* DcMotorController, and one ServoController.
*
* We accomplish this by initializing Motor and Servo controller with the same name
* given in the configuration. In the example below the name of the controller is
* "MatrixController"
*
* Normally we don't need to access the controllers themselves, we deal directly with
* the Motor and Servo objects, but the Matrix interface is different.
*
* In order to activate the servos, they need to be enabled on the controller with
* a call to pwmEnable() and disabled with a call to pwmDisable()
*
* Also, the Matrix Motor controller interface provides a call that enables all motors to
* updated simultaneously (with the same value).
*/
// Initialize Matrix Motor and Servo objects
matrixMotorController = ahwMap.get(MatrixDcMotorController.class, "matrix controller");
matrixServoController = ahwMap.get(ServoController.class, "matrix controller");
// Enable Servos
matrixServoController.pwmEnable(); // Don't forget to enable Matrix Output
}
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:34,代码来源:HardwarePushbotMatrix.java示例8: FtcBNO055Imu
import com.qualcomm.robotcore.hardware.HardwareMap; //导入方法依赖的package包/类
/**
* Constructor: Creates an instance of the object.
*
* @param hardwareMap specifies the global hardware map.
* @param instanceName specifies the instance name.
*/
public FtcBNO055Imu(HardwareMap hardwareMap, String instanceName)
{
if (debugEnabled)
{
dbgTrace = new TrcDbgTrace(moduleName + "." + instanceName, tracingEnabled, traceLevel, msgLevel);
}
//
// Initialize the BNO055 IMU.
//
BNO055IMU.Parameters imuParams = new BNO055IMU.Parameters();
if (USE_QUATERNION)
{
imuParams.mode = BNO055IMU.SensorMode.IMU;
imuParams.useExternalCrystal = true;
imuParams.pitchMode = BNO055IMU.PitchMode.WINDOWS;
}
else
{
imuParams.calibrationDataFile = "BNO055IMUCalibration.json";
}
imuParams.angleUnit = BNO055IMU.AngleUnit.DEGREES;
imuParams.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;
imuParams.loggingEnabled = true;
imuParams.loggingTag = "IMU";
imuParams.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();
imu = hardwareMap.get(BNO055IMU.class, instanceName);
imu.initialize(imuParams);
//
// Create the gyro object of the IMU.
// Note that the heading data on the z-axis is in Ordinal system with a range of -180 to 180 degrees.
// So we need to initialize the Cartesian converter with the range values.
//
gyro = new Gyro(instanceName);
//
// Note:
// We can convert only X (roll) and Z (yaw) axes to Cartesian.
// For Y (pitch), when pointing upright, it will return 90-degree but pitching forward or backward will
// yield the same decrement. So one can't tell if it is rotating forward or backward. This makes it
// impossible to do the Cartesian conversion.
//
gyro.setXValueRange(-180.0, 180.0);
gyro.setZValueRange(-180.0, 180.0);
//
// Create the accelerometer object of the IMU.
//
accel = new Accelerometer(instanceName);
}
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:54,代码来源:FtcBNO055Imu.java示例9: bno055driver
import com.qualcomm.robotcore.hardware.HardwareMap; //导入方法依赖的package包/类
public bno055driver(String name, HardwareMap hwmap) {
this.name = name;
imu = hwmap.get(BNO055IMU.class, name);
setParameters();
}
开发者ID:nomelif,项目名称:ControlCodesRepo,代码行数:6,代码来源:bno055driver.java本文标签属性:
示例:示例是什么意思
代码:代码生成器
java:java游戏
HardwareMap:HardwareMap