mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
The models and meshes are not included. We will need to find an alternate way to reintegrate these and use them. * Add simulation/gz_msgs back, and build with Gradle. * Add back in the frc simulation plugins for gazebo. * Add a new shared library, halsim_gazebo. This library will become the interface between the HAL sim layer and gazebo. * Preserve the first channel number used in created Encoders in the Sim MockData. This allows us to use the DIO channel number to connect with simulated encoders. * Have the HAL Simulator set the reverse direction on creation. This enables a simulator to be aware of the direction. * Add a drive_motor plugin. This is a bit of a 'magic' motor, which allows us to build robot models that drive in a more realistic fashion. It does this by apply forces directly to the chassis, rather than relying on the complex motion dynamics of a driven wheel. This in turn allows the model to reduce wheel friction, reducing scrub, and allowing for a more natural driving experience.
93 lines
4.4 KiB
C
93 lines
4.4 KiB
C
/*----------------------------------------------------------------------------*/
|
|
/* Copyright (c) 2017-2018 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. */
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
#pragma once
|
|
|
|
#ifndef __FRC_ROBORIO__
|
|
|
|
#include "HAL/HAL.h"
|
|
#include "NotifyListener.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
void HALSIM_ResetEncoderData(int32_t index);
|
|
int16_t HALSIM_GetDigitalChannelA(int32_t index);
|
|
int32_t HALSIM_RegisterEncoderInitializedCallback(int32_t index,
|
|
HAL_NotifyCallback callback,
|
|
void* param,
|
|
HAL_Bool initialNotify);
|
|
void HALSIM_CancelEncoderInitializedCallback(int32_t index, int32_t uid);
|
|
HAL_Bool HALSIM_GetEncoderInitialized(int32_t index);
|
|
void HALSIM_SetEncoderInitialized(int32_t index, HAL_Bool initialized);
|
|
|
|
int32_t HALSIM_RegisterEncoderCountCallback(int32_t index,
|
|
HAL_NotifyCallback callback,
|
|
void* param,
|
|
HAL_Bool initialNotify);
|
|
void HALSIM_CancelEncoderCountCallback(int32_t index, int32_t uid);
|
|
int32_t HALSIM_GetEncoderCount(int32_t index);
|
|
void HALSIM_SetEncoderCount(int32_t index, int32_t count);
|
|
|
|
int32_t HALSIM_RegisterEncoderPeriodCallback(int32_t index,
|
|
HAL_NotifyCallback callback,
|
|
void* param,
|
|
HAL_Bool initialNotify);
|
|
void HALSIM_CancelEncoderPeriodCallback(int32_t index, int32_t uid);
|
|
double HALSIM_GetEncoderPeriod(int32_t index);
|
|
void HALSIM_SetEncoderPeriod(int32_t index, double period);
|
|
|
|
int32_t HALSIM_RegisterEncoderResetCallback(int32_t index,
|
|
HAL_NotifyCallback callback,
|
|
void* param,
|
|
HAL_Bool initialNotify);
|
|
void HALSIM_CancelEncoderResetCallback(int32_t index, int32_t uid);
|
|
HAL_Bool HALSIM_GetEncoderReset(int32_t index);
|
|
void HALSIM_SetEncoderReset(int32_t index, HAL_Bool reset);
|
|
|
|
int32_t HALSIM_RegisterEncoderMaxPeriodCallback(int32_t index,
|
|
HAL_NotifyCallback callback,
|
|
void* param,
|
|
HAL_Bool initialNotify);
|
|
void HALSIM_CancelEncoderMaxPeriodCallback(int32_t index, int32_t uid);
|
|
double HALSIM_GetEncoderMaxPeriod(int32_t index);
|
|
void HALSIM_SetEncoderMaxPeriod(int32_t index, double maxPeriod);
|
|
|
|
int32_t HALSIM_RegisterEncoderDirectionCallback(int32_t index,
|
|
HAL_NotifyCallback callback,
|
|
void* param,
|
|
HAL_Bool initialNotify);
|
|
void HALSIM_CancelEncoderDirectionCallback(int32_t index, int32_t uid);
|
|
HAL_Bool HALSIM_GetEncoderDirection(int32_t index);
|
|
void HALSIM_SetEncoderDirection(int32_t index, HAL_Bool direction);
|
|
|
|
int32_t HALSIM_RegisterEncoderReverseDirectionCallback(
|
|
int32_t index, HAL_NotifyCallback callback, void* param,
|
|
HAL_Bool initialNotify);
|
|
void HALSIM_CancelEncoderReverseDirectionCallback(int32_t index, int32_t uid);
|
|
HAL_Bool HALSIM_GetEncoderReverseDirection(int32_t index);
|
|
void HALSIM_SetEncoderReverseDirection(int32_t index,
|
|
HAL_Bool reverseDirection);
|
|
|
|
int32_t HALSIM_RegisterEncoderSamplesToAverageCallback(
|
|
int32_t index, HAL_NotifyCallback callback, void* param,
|
|
HAL_Bool initialNotify);
|
|
void HALSIM_CancelEncoderSamplesToAverageCallback(int32_t index, int32_t uid);
|
|
int32_t HALSIM_GetEncoderSamplesToAverage(int32_t index);
|
|
void HALSIM_SetEncoderSamplesToAverage(int32_t index, int32_t samplesToAverage);
|
|
|
|
void HALSIM_RegisterEncoderAllCallbacks(int32_t index,
|
|
HAL_NotifyCallback callback,
|
|
void* param, HAL_Bool initialNotify);
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif
|
|
|
|
#endif
|