WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
SendableChooserSim.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <string_view>
8
11
12#include "frc/RobotBase.h"
13
14namespace frc::sim {
15
16/**
17 * Class that facilitates control of a SendableChooser's selected option in
18 * simulation.
19 */
21 public:
22 /**
23 * Constructs a SendableChooserSim.
24 *
25 * @param path The path where the SendableChooser is published.
26 */
27 explicit SendableChooserSim(std::string_view path);
28
29 /**
30 * Constructs a SendableChooserSim.
31 *
32 * @param inst The NetworkTables instance.
33 * @param path The path where the SendableChooser is published.
34 */
35 SendableChooserSim(nt::NetworkTableInstance inst, std::string_view path);
36
37 /**
38 * Set the selected option.
39 * @param option The option.
40 */
41 void SetSelected(std::string_view option);
42
43 private:
44 nt::StringPublisher m_publisher;
45};
46} // namespace frc::sim
Class that facilitates control of a SendableChooser's selected option in simulation.
Definition SendableChooserSim.h:20
SendableChooserSim(nt::NetworkTableInstance inst, std::string_view path)
Constructs a SendableChooserSim.
SendableChooserSim(std::string_view path)
Constructs a SendableChooserSim.
void SetSelected(std::string_view option)
Set the selected option.
NetworkTables Instance.
Definition NetworkTableInstance.h:68
NetworkTables String publisher.
Definition StringTopic.h:184
Definition SimHooks.h:12