18 #include <ros/console.h> 19 #include <gazebo_msgs/ModelStates.h> 31 int main(
int argc,
char** argv) {
32 ros::init(argc, argv,
"vision_adapter");
37 int32_t multicast_port = vision_configurer.
get_port();
38 std::string multicast_address_str = vision_configurer.
get_address();
54 ROS_ERROR_STREAM(
"Invalid number of robots per team");
59 gazebo_msgs::ModelStates::ConstPtr world_state;
61 ROS_INFO_STREAM(
"Vision adapter config:" << std::endl << vision_configurer);
66 if (vision_receiver.
receive(&world_state)) {
68 vision_sender.
send(&field_state);
73 multicast_port = vision_configurer.
get_port();
74 multicast_address_str = vision_configurer.
get_address();
78 ROS_INFO_STREAM(
"Vision adapter config:" << std::endl << vision_configurer);
ROS vision receiver class definition.
Data structure to hold the field state.
Entity state data structure.
void set_multicast_endpoint(const std::string multicast_address, const short multicast_port)
Set the multicast endpoint.
travesim::FieldState ModelStates_to_FieldState(gazebo_msgs::ModelStates::ConstPtr model_states, TeamsFormation teams_formation)
Function to convert gazebo_msgs::ModelStates to travesim::FieldState.
Robot state data structure.
Collection of data converters between ROS and local formats.
Vision data sender with UDP and protobuf.
Vision sender class with UDP and protobuf.
Class to receive Gazebo published messages.
TeamsFormation
Formation of the teams.
bool send(FieldState *p_field_state)
Send vision data with UDP and protobuf.
bool receive(gazebo_msgs::ModelStates::ConstPtr *msg)
Get last received message.
int main(int argc, char **argv)