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( button->move(
static_cast<int>(msg->pose.x * ratioX - (w * ratioX) / 2), static_cast<int>(msg->x * ratioX - (w * ratioX) / 2),
static_cast<int>(800 - msg->pose.y * ratioY - (h * ratioY) / 2) static_cast<int>(800 - msg->y * ratioY - (h * ratioY) / 2)
); );
button->setFixedSize(w * ratioX, h * ratioY); button->setFixedSize(w * ratioX, h * ratioY);

View File

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

View File

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