mirror of
https://github.com/modelec/modelec-marcel-ROS.git
synced 2026-01-18 16:47:43 +01:00
gui
This commit is contained in:
@@ -255,15 +255,6 @@ namespace ModelecGUI
|
||||
|
||||
go_to_pub_->publish(msg);
|
||||
}
|
||||
|
||||
else if (event->button() == Qt::RightButton)
|
||||
{
|
||||
enemy_pos_.x = Modelec::mapValue(event->pos().x(), 0, width(), 0, 3000);
|
||||
enemy_pos_.y = 2000 - Modelec::mapValue(event->pos().y(), 0, height(), 0, 2000);
|
||||
enemy_pos_.theta = 0;
|
||||
|
||||
enemy_pos_pub_->publish(enemy_pos_);
|
||||
}
|
||||
}
|
||||
|
||||
void MapPage::mouseReleaseEvent(QMouseEvent* event)
|
||||
@@ -279,6 +270,15 @@ namespace ModelecGUI
|
||||
void MapPage::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
QWidget::mouseMoveEvent(event);
|
||||
|
||||
if (event->button() == Qt::RightButton)
|
||||
{
|
||||
enemy_pos_.x = Modelec::mapValue(event->pos().x(), 0, width(), 0, 3000);
|
||||
enemy_pos_.y = 2000 - Modelec::mapValue(event->pos().y(), 0, height(), 0, 2000);
|
||||
enemy_pos_.theta = 0;
|
||||
|
||||
enemy_pos_pub_->publish(enemy_pos_);
|
||||
}
|
||||
}
|
||||
|
||||
void MapPage::OnObstacleReceived(const modelec_interfaces::msg::Obstacle::SharedPtr msg)
|
||||
|
||||
Reference in New Issue
Block a user