mirror of
https://github.com/modelec/modelec-marcel-ROS.git
synced 2026-01-18 16:47:43 +01:00
refactoring
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user