refactoring

This commit is contained in:
acki
2025-05-20 10:31:39 -04:00
parent 4a4087a977
commit ee90e07011
3 changed files with 11 additions and 9 deletions

View File

@@ -34,8 +34,8 @@ namespace ModelecGUI
);
button->move(
static_cast<int>(msg->pose.x * ratioX - (w * ratioX) / 2),
static_cast<int>(800 - msg->pose.y * ratioY - (h * ratioY) / 2)
static_cast<int>(msg->x * ratioX - (w * ratioX) / 2),
static_cast<int>(800 - msg->y * ratioY - (h * ratioY) / 2)
);
button->setFixedSize(w * ratioX, h * ratioY);

View File

@@ -2,6 +2,8 @@ string TOP="top"
string BOTTOM="bottom"
string SIDE="side"
geometry_msgs/Pose2D pose
int32 x
int32 y
float32 theta
int32 team_id
string name

View File

@@ -74,9 +74,9 @@ namespace Modelec
auto s = modelec_interfaces::msg::Spawn();
s.team_id = YELLOW;
s.name = ys.first;
s.pose.x = ys.second.x;
s.pose.y = ys.second.y;
s.pose.theta = ys.second.theta;
s.x = ys.second.x;
s.y = ys.second.y;
s.theta = ys.second.theta;
spawn_pub_->publish(s);
}
@@ -86,9 +86,9 @@ namespace Modelec
auto s = modelec_interfaces::msg::Spawn();
s.team_id = BLUE;
s.name = bs.first;
s.pose.x = bs.second.x;
s.pose.y = bs.second.y;
s.pose.theta = bs.second.theta;
s.x = bs.second.x;
s.y = bs.second.y;
s.theta = bs.second.theta;
spawn_pub_->publish(s);
}