Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion sim_ws/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ services:
- ../sim_ws/src/scripts:/sim_ws/src/scripts
- ../sim_ws/src/visualization:/sim_ws/src/visualization
- ../sim_ws/src/arcus_gui:/sim_ws/src/arcus_gui
- ../sim_ws/src/map_cleaner:/sim_ws/src/map_cleaner
- ../../arcus:/sim_ws/src/arcus
- /tmp/.X11-unix:/tmp/.X11-unix:rw
environment:
Expand Down
1 change: 1 addition & 0 deletions sim_ws/src/arcus_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ add_executable(main_gui src/gui.cpp
src/QWidget/QLocalNodes/QLocalNodes.cpp
src/QWidget/QMapRacelineHelpers/QMapRacelineHelpers.cpp
src/QWidget/QPurePursuitWidget/QPurePursuit.cpp
src/QWidget/QGapFollow/QGapFollow.cpp
src/QWidget/QArcusMaster/QSafetyWidget/QSafetyWidget.cpp
src/Global/Helper/QTopicSelector/QTopicSelector.cpp
src/Global/Helper/QProcessHandler/QProcessHandler.cpp
Expand Down
4 changes: 2 additions & 2 deletions sim_ws/src/arcus_gui/src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MainWindow::MainWindow(std::shared_ptr<rclcpp::Node> guiNode_):
_localNodesWidget(guiNode_, this),
_mapRacelineHelpers(guiNode_, this),
_purePursuitWidget(guiNode_, this),
_exampleWidget5(this)
_gapFollowWidget(guiNode_, this)
{

this->setCentralWidget(&_centralWidget);
Expand All @@ -18,7 +18,7 @@ MainWindow::MainWindow(std::shared_ptr<rclcpp::Node> guiNode_):
_gridLayout.addWidget(&_localNodesWidget, 0, 2);
_gridLayout.addWidget(&_mapRacelineHelpers, 1, 0);
_gridLayout.addWidget(&_purePursuitWidget, 1, 1);
_gridLayout.addWidget(&_exampleWidget5, 1, 2);
_gridLayout.addWidget(&_gapFollowWidget, 1, 2);

_gridLayout.setColumnStretch(0, 1);
_gridLayout.setColumnStretch(1, 1);
Expand Down
3 changes: 2 additions & 1 deletion sim_ws/src/arcus_gui/src/MainWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "QWidget/QArcusMaster/QArcusMaster.hpp"
#include "QWidget/QLocalNodes/QLocalNodes.hpp"
#include "QWidget/QPurePursuitWidget/QPurePursuit.hpp"
#include "QWidget/QGapFollow/QGapFollow.hpp"
#include "QWidget/QMapRacelineHelpers/QMapRacelineHelpers.hpp"
#include "rclcpp/rclcpp.hpp"

Expand All @@ -37,7 +38,7 @@ class MainWindow : public QMainWindow
QLocalNodesWidget _localNodesWidget;
QMapRacelineHelpers _mapRacelineHelpers;
QPurePursuitWidget _purePursuitWidget;
QWidget _exampleWidget5;
QGapFollowWidget _gapFollowWidget;
};

#endif // MAIN_WINDOWS_HPP
18 changes: 18 additions & 0 deletions sim_ws/src/arcus_gui/src/QWidget/QGapFollow/QGapFollow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "QGapFollow.hpp"
#include <yaml-cpp/yaml.h>

QGapFollowWidget::QGapFollowWidget(std::shared_ptr<rclcpp::Node> node_, QWidget* parent_):
QWidget(parent_),
_node(node_),
_maxSpeedSlider(parent_, node_, MAX_SPEED_PARAM_NAME, GAP_FOLLOW_NODE_NAME, MAX_SPEED_MIN, MAX_SPEED_MAX, MAX_SPEED_DEFAULT, SPEED_PRECISION),
_distanceSpeedGainSlider(parent_, node_, DISTANCE_SPEED_GAIN_PARAM_NAME, GAP_FOLLOW_NODE_NAME, DISTANCE_SPEED_GAIN_MIN, DISTANCE_SPEED_GAIN_MAX, DISTANCE_SPEED_GAIN_DEFAULT, DISTANCE_SPEED_GAIN_PRECISION),
_bubbleRadiusSlider(parent_, node_, BUBBLE_RADIUS_PARAM_NAME, GAP_FOLLOW_NODE_NAME, BUBBLE_RADIUS_MIN, BUBBLE_RADIUS_MAX, BUBBLE_RADIUS_DEFAULT, BUBBLE_RADIUS_PRECISION),
_staticFrictionCoeffSlider(parent_, node_, STATIC_FRICTION_COEFF, GAP_FOLLOW_NODE_NAME, STATIC_FRICTION_COEFF_MIN, STATIC_FRICTION_COEFF_MAX, STATIC_FRICTION_COEFF_DEFAULT, STATIC_FRICTION_COEFF_PRECISION)
{
_ui.setupUi(this);

_ui.sliderLayout->addWidget(&_maxSpeedSlider);
_ui.sliderLayout->addWidget(&_distanceSpeedGainSlider);
_ui.sliderLayout->addWidget(&_bubbleRadiusSlider);
_ui.sliderLayout->addWidget(&_staticFrictionCoeffSlider);
}
57 changes: 57 additions & 0 deletions sim_ws/src/arcus_gui/src/QWidget/QGapFollow/QGapFollow.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#ifndef Q_GAP_FOLLOW_WIDGET_HPP
#define Q_GAP_FOLLOW_WIDGET_HPP

#include "UI_GapFollowWidget.h"
#include "Global/Helper/QParamSlider/QParamSlider.hpp"

#include <rclcpp/rclcpp.hpp>
#include <QtWidgets/QWidget>

class QGapFollowWidget : public QWidget
{
Q_OBJECT

static constexpr const char* GAP_FOLLOW_NODE_NAME = "/arcus/gap_follow";
static constexpr const char* MAX_SPEED_PARAM_NAME = "max_speed";
static constexpr const char* DISTANCE_SPEED_GAIN_PARAM_NAME = "speed_distance_factor";
static constexpr const char* BUBBLE_RADIUS_PARAM_NAME = "bubble_radius";
static constexpr const char* STATIC_FRICTION_COEFF = "static_friction_coeff";

static constexpr float MAX_SPEED_DEFAULT = 5;
static constexpr float DISTANCE_SPEED_GAIN_DEFAULT = 1.2;
static constexpr float BUBBLE_RADIUS_DEFAULT = 0.3;
static constexpr float STATIC_FRICTION_COEFF_DEFAULT = 0.7;

static constexpr float MAX_SPEED_MIN = 0.0;
static constexpr float DISTANCE_SPEED_GAIN_MIN = 0.0;
static constexpr float BUBBLE_RADIUS_MIN = 0.0;
static constexpr float STATIC_FRICTION_COEFF_MIN = 0.0;

static constexpr float MAX_SPEED_MAX = 20.0;
static constexpr float DISTANCE_SPEED_GAIN_MAX = 10.0;
static constexpr float BUBBLE_RADIUS_MAX = 1.0;
static constexpr float STATIC_FRICTION_COEFF_MAX = 5.0;

static constexpr float SPEED_PRECISION = 0.05;
static constexpr float DISTANCE_SPEED_GAIN_PRECISION = 0.05;
static constexpr float BUBBLE_RADIUS_PRECISION = 0.05;
static constexpr float STATIC_FRICTION_COEFF_PRECISION = 0.05;


public:
QGapFollowWidget(std::shared_ptr<rclcpp::Node> node_, QWidget* parent_);

private:
void setupUI(void);

std::shared_ptr<rclcpp::Node> _node;

QParamSlider _maxSpeedSlider;
QParamSlider _distanceSpeedGainSlider;
QParamSlider _bubbleRadiusSlider;
QParamSlider _staticFrictionCoeffSlider;

Ui::gapFollowWidget _ui;
};

#endif // Q_GAP_FOLLOW_WIDGET_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
QMapRacelineHelpers::QMapRacelineHelpers(std::shared_ptr<rclcpp::Node> node_, QWidget* parent_):
QWidget(parent_),
_node(node_),
_mapCarToLocalProcess(this, "Map (Car to Local)", MAP_CAR_TO_LOCAL_CMD, true),
_racelineScriptProcess(this, "Raceline Script", RACELINE_SCRIPT_CMD, true),
_waypointsLocalToCarProcess(this, "Waypoints (Local to Car)", WAYPOINTS_LOCAL_TO_CAR_CMD, true)
_racelineHelper(this, "Raceline Helpers", RACELINE_HELPER_CMD, true)
{
_ui.setupUi(this);
_ui.buttonsLayout->addWidget(&_mapCarToLocalProcess);
_ui.buttonsLayout->addWidget(&_racelineScriptProcess);
_ui.buttonsLayout->addWidget(&_waypointsLocalToCarProcess);
_ui.buttonsLayout->addWidget(&_racelineHelper);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class QMapRacelineHelpers : public QWidget
{
Q_OBJECT

static constexpr const char* MAP_CAR_TO_LOCAL_CMD = "source /opt/ros/humble/setup.bash && ros2 launch f1tenth_gym_ros visualize_launch.py";
static constexpr const char* RACELINE_SCRIPT_CMD = "source /opt/ros/humble/setup.bash && ros2 launch drive_controller drive_controller.launch.py";
static constexpr const char* WAYPOINTS_LOCAL_TO_CAR_CMD = "source /opt/ros/humble/setup.bash && ros2 launch drive_controller drive_controller.launch.py";
static constexpr const char* RACELINE_HELPER_CMD = "python3 /sim_ws/src/scripts/map_preparation/prepare_map.py";

public:
QMapRacelineHelpers(std::shared_ptr<rclcpp::Node> node_, QWidget* parent_);
Expand All @@ -25,9 +23,7 @@ class QMapRacelineHelpers : public QWidget

std::shared_ptr<rclcpp::Node> _node;

QProcessHandler _mapCarToLocalProcess;
QProcessHandler _racelineScriptProcess;
QProcessHandler _waypointsLocalToCarProcess;
QProcessHandler _racelineHelper;

Ui::MapRacelineHelpers _ui;
};
Expand Down
58 changes: 58 additions & 0 deletions sim_ws/src/arcus_gui/ui/ui/GapFollowWidget.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>gapFollowWidget</class>
<widget class="QWidget" name="gapFollowWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>611</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="sliderLayout">
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="font">
<font>
<pointsize>24</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>GAP FOLLOW</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
2 changes: 1 addition & 1 deletion sim_ws/src/arcus_gui/ui/ui/MapRacelineHelpers.ui
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</font>
</property>
<property name="text">
<string>MAP/RACELINE HELPERS</string>
<string>MAPPIN AND RISK</string>
</property>
<property name="echoMode">
<enum>QLineEdit::Normal</enum>
Expand Down
2 changes: 1 addition & 1 deletion sim_ws/src/scripts/map_preparation/utils/exportAlgos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USER="arcus"
HOST="arcus-jetson.local"

RACELINE_FILE="saved/algos.csv"
REMOTE_RACELINE_DIR="/home/arcus/arcus/resources/waypoints"
REMOTE_RACELINE_DIR="/home/arcus/arcus/resources"

echo "Sending raceline back to remote..."
scp "$RACELINE_FILE" "$USER@$HOST:$REMOTE_RACELINE_DIR"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USER="arcus"
HOST="arcus-jetson.local"

RACELINE_FILE="saved/speed_zones.csv"
REMOTE_RACELINE_DIR="/home/arcus/arcus/resources/waypoints"
REMOTE_RACELINE_DIR="/home/arcus/arcus/resources"

echo "Sending raceline back to remote..."
scp "$RACELINE_FILE" "$USER@$HOST:$REMOTE_RACELINE_DIR"
Expand Down
Loading