mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Add a unified PCM object (#3331)
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
#include <string>
|
||||
|
||||
#include <hal/Value.h>
|
||||
#include <hal/simulation/CTREPCMData.h>
|
||||
#include <hal/simulation/NotifyListener.h>
|
||||
#include <hal/simulation/PCMData.h>
|
||||
|
||||
#include "simulation/gz_msgs/msgs.h"
|
||||
|
||||
@@ -30,10 +30,9 @@ GazeboPCM::GazeboPCM(int index, int channel, HALSimGazebo* halsim) {
|
||||
m_channel = channel;
|
||||
m_halsim = halsim;
|
||||
m_pub = NULL;
|
||||
HALSIM_RegisterPCMSolenoidInitializedCallback(index, channel, init_callback,
|
||||
this, true);
|
||||
HALSIM_RegisterPCMSolenoidOutputCallback(index, channel, output_callback,
|
||||
this, true);
|
||||
HALSIM_RegisterCTREPCMInitializedCallback(index, init_callback, this, true);
|
||||
HALSIM_RegisterCTREPCMSolenoidOutputCallback(index, channel, output_callback,
|
||||
this, true);
|
||||
}
|
||||
|
||||
void GazeboPCM::Publish(bool value) {
|
||||
@@ -50,5 +49,5 @@ void GazeboPCM::Publish(bool value) {
|
||||
}
|
||||
|
||||
void GazeboPCM_SetPressureSwitch(int index, bool value) {
|
||||
HALSIM_SetPCMPressureSwitch(index, value);
|
||||
HALSIM_SetCTREPCMPressureSwitch(index, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user