2017-10-16 22:54:36 -04:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2019-09-14 15:22:54 -05:00
|
|
|
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
|
2017-10-16 22:54:36 -04:00
|
|
|
/* 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
|
|
|
|
|
|
2019-09-14 15:22:54 -05:00
|
|
|
#include "frc/smartdashboard/SendableRegistry.h"
|
|
|
|
|
|
2017-10-16 22:54:36 -04:00
|
|
|
namespace frc {
|
|
|
|
|
|
|
|
|
|
template <class... SpeedControllers>
|
|
|
|
|
SpeedControllerGroup::SpeedControllerGroup(
|
|
|
|
|
SpeedController& speedController, SpeedControllers&... speedControllers)
|
2017-12-04 23:28:33 -08:00
|
|
|
: m_speedControllers{speedController, speedControllers...} {
|
|
|
|
|
for (auto& speedController : m_speedControllers)
|
2019-09-14 15:22:54 -05:00
|
|
|
SendableRegistry::GetInstance().AddChild(this, &speedController.get());
|
2017-12-04 23:28:33 -08:00
|
|
|
static int instances = 0;
|
|
|
|
|
++instances;
|
2019-09-14 15:22:54 -05:00
|
|
|
SendableRegistry::GetInstance().Add(this, "SpeedControllerGroup", instances);
|
2017-12-04 23:28:33 -08:00
|
|
|
}
|
2017-10-16 22:54:36 -04:00
|
|
|
|
|
|
|
|
} // namespace frc
|