18 #ifndef VMRC_GAZEBO_SYMBOL_CONTROLLER_HH_ 19 #define VMRC_GAZEBO_SYMBOL_CONTROLLER_HH_ 22 #include <std_msgs/ColorRGBA.h> 23 #include <std_srvs/Trigger.h> 28 #include <gazebo/gazebo.hh> 49 public:
virtual void Load(gazebo::physics::ModelPtr _parent,
50 sdf::ElementPtr _sdf);
59 private:
bool Shuffle(std_srvs::Trigger::Request &_req,
60 std_srvs::Trigger::Response &_res);
79 private:
static std::map<std::string, std_msgs::ColorRGBA>
kColors;
83 private:
static std::vector<std::string>
kShapes;
std::string color
The current color.
void Shuffle()
Create a new combination of shape/color.
ros::NodeHandle nh
Node handle.
virtual void Load(gazebo::physics::ModelPtr _parent, sdf::ElementPtr _sdf)
std::vector< ros::Publisher > symbolPubs
Publisher to set the color to each of the 3 potential shapes.
static std::map< std::string, std_msgs::ColorRGBA > kColors
List of the color options (red, green, blue, and no color) with their string name for logging...
void ShuffleColor()
Choose a new random color.
Controls the shape and color of a symbol.
std::string shape
The current shape.
static std::vector< std::string > kShapes
List of the shape options (circle, cross, triangle) with their string name for logging.
SymbolController()=default
Constructor.
ros::Timer timer
Timer triggered in simulated time to update the shape/color for.
ros::ServiceServer changePatternServer
Service to generate a new random shape/color.
void Publish()
Publish the current shape/color combination.
void ShuffleShape()
Choose a new random shape.