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(
|
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);
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user