mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Fix Gazebo sim plugin build (#1959)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2014-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2014-2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <hal/Value.h>
|
||||
#include <mockdata/EncoderData.h>
|
||||
#include <mockdata/HAL_Value.h>
|
||||
#include <mockdata/NotifyListener.h>
|
||||
|
||||
static void encoder_init_callback(const char* name, void* param,
|
||||
@@ -54,7 +54,7 @@ void GazeboEncoder::Control(const char* command) {
|
||||
if (!m_pub) {
|
||||
m_pub = m_halsim->node.Advertise<gazebo::msgs::String>(
|
||||
"~/simulator/encoder/dio/" +
|
||||
std::to_string(HALSIM_GetDigitalChannelA(m_index)) + "/control");
|
||||
std::to_string(HALSIM_GetEncoderDigitalChannelA(m_index)) + "/control");
|
||||
m_pub->WaitForConnection(gazebo::common::Time(1, 0));
|
||||
}
|
||||
gazebo::msgs::String msg;
|
||||
@@ -66,7 +66,8 @@ void GazeboEncoder::Listen() {
|
||||
if (!m_sub)
|
||||
m_sub = m_halsim->node.Subscribe<gazebo::msgs::Float64>(
|
||||
"~/simulator/encoder/dio/" +
|
||||
std::to_string(HALSIM_GetDigitalChannelA(m_index)) + "/position",
|
||||
std::to_string(HALSIM_GetEncoderDigitalChannelA(m_index)) +
|
||||
"/position",
|
||||
&GazeboEncoder::Callback, this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user