kauailabs / navxmxp

Robotics Navigation Sensors. NavX-MXP designed for the National Instruments RoboRIO & FIRST FRC Robotics. Navx-MIcro designed for Android-based FIRST FTC Robots
MIT License
105 stars 89 forks source link

Docs example for java simulation does not work #98

Closed 28andrew closed 3 years ago

28andrew commented 3 years ago

In the library docs for Java, the provided code snippet:

int dev = SimDeviceDataJNI.getSimDeviceHandle(“navX-Sensor”);
SimDouble angle = new SimDouble(SimDeviceDataJNI.getSimValueHandle(dev, “Yaw”));
angle.set(5.0);

does not work. navX-Sensor should be replaced with navX-Sensor[0] as this is how the SimDevice is created in the library. I would guess the C++ example has the same issue.

kauailabs commented 3 years ago

Fixed on the website; thanks for reporting this!