[hal] Add a unified PCM object (#3331)

This commit is contained in:
Thad House
2021-06-05 22:36:39 -07:00
committed by GitHub
parent dea841103d
commit 0e702eb799
103 changed files with 2643 additions and 5676 deletions

View File

@@ -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);
}