Skip to content
5 changes: 5 additions & 0 deletions romiVendordep/src/main/java/org/wpilib/romi/RomiGyro.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package org.wpilib.romi;

import org.wpilib.driverstation.DriverStation;
import org.wpilib.hardware.hal.SimDevice;
import org.wpilib.hardware.hal.SimDevice.Direction;
import org.wpilib.hardware.hal.SimDouble;
Expand Down Expand Up @@ -39,6 +40,10 @@ public RomiGyro() {
m_simAngleX = m_simDevice.createDouble("angle_x", Direction.kInput, 0.0);
m_simAngleY = m_simDevice.createDouble("angle_y", Direction.kInput, 0.0);
m_simAngleZ = m_simDevice.createDouble("angle_z", Direction.kInput, 0.0);

System.out.println("Name of connected device: " + m_simDevice.getName());
System.out.println("Robot Enable Status: " + DriverStation.isEnabled());
System.out.println("E-Stop Status: " + DriverStation.isEStopped());
} else {
m_simRateX = null;
m_simRateY = null;
Expand Down
8 changes: 8 additions & 0 deletions romiVendordep/src/main/native/cpp/romi/RomiGyro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

#include "wpi/romi/RomiGyro.hpp"

#include <fmt/std.h>

#include "string"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ standard library includes should use <>.

#include "wpi/driverstation/DriverStation.hpp"

using namespace wpi::romi;

RomiGyro::RomiGyro() : m_simDevice("Gyro:RomiGyro") {
Expand All @@ -22,6 +27,9 @@ RomiGyro::RomiGyro() : m_simDevice("Gyro:RomiGyro") {
m_simAngleZ =
m_simDevice.CreateDouble("angle_z", hal::SimDevice::kInput, 0.0);
}
fmt::print("Name of connected device: {}\n", m_simDevice.GetName());
fmt::print("Robot Enable Status: {}\n", wpi::DriverStation::IsEnabled());
fmt::print("E-Stop Status: {}\n", wpi::DriverStation::IsEStopped());
}

wpi::units::radian_t RomiGyro::GetAngle() const {
Expand Down
5 changes: 5 additions & 0 deletions xrpVendordep/src/main/java/org/wpilib/xrp/XRPGyro.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package org.wpilib.xrp;

import org.wpilib.driverstation.DriverStation;
import org.wpilib.hardware.hal.SimDevice;
import org.wpilib.hardware.hal.SimDevice.Direction;
import org.wpilib.hardware.hal.SimDouble;
Expand Down Expand Up @@ -44,6 +45,10 @@ public XRPGyro() {
m_simAngleX = m_simDevice.createDouble("angle_x", Direction.kInput, 0.0);
m_simAngleY = m_simDevice.createDouble("angle_y", Direction.kInput, 0.0);
m_simAngleZ = m_simDevice.createDouble("angle_z", Direction.kInput, 0.0);

System.out.println("Name of connected device: " + m_simDevice.getName());
System.out.println("Robot Enable Status: " + DriverStation.isEnabled());
System.out.println("E-Stop Status: " + DriverStation.isEStopped());
} else {
m_simRateX = null;
m_simRateY = null;
Expand Down
7 changes: 7 additions & 0 deletions xrpVendordep/src/main/native/cpp/xrp/XRPGyro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

#include "wpi/xrp/XRPGyro.hpp"

#include <fmt/std.h>

#include "string"
#include "wpi/driverstation/DriverStation.hpp"
#include "wpi/units/angle.hpp"
#include "wpi/units/angular_velocity.hpp"

Expand All @@ -25,6 +29,9 @@ XRPGyro::XRPGyro() : m_simDevice("Gyro:XRPGyro") {
m_simAngleZ =
m_simDevice.CreateDouble("angle_z", hal::SimDevice::kInput, 0.0);
}
fmt::print("Name of connected device: {}\n", m_simDevice.GetName());
fmt::print("Robot Enable Status: {}\n", wpi::DriverStation::IsEnabled());
fmt::print("E-Stop Status: {}\n", wpi::DriverStation::IsEStopped());
}

wpi::units::radian_t XRPGyro::GetAngle() const {
Expand Down
Loading