Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
3f4f83e
log
Ackimixs Dec 17, 2025
d4a9f97
log
Ackimixs Dec 17, 2025
ccde341
log
Ackimixs Dec 17, 2025
9696385
log
Ackimixs Dec 17, 2025
c4a8c28
ask waypoint to pcb
Ackimixs Dec 17, 2025
83cd0f7
ask waypoint to pcb
Ackimixs Dec 17, 2025
cdbf41e
ask waypoint to pcb
Ackimixs Dec 17, 2025
8858e6d
log
Ackimixs Dec 17, 2025
f1e0a74
log
Ackimixs Dec 17, 2025
c2711a1
servo value
Ackimixs Dec 18, 2025
e92b128
servo value
Ackimixs Dec 18, 2025
5246198
servo value
Ackimixs Dec 18, 2025
0bbf669
servo value
Ackimixs Dec 18, 2025
b6736f3
servo value
Ackimixs Dec 18, 2025
8241d16
servo value
Ackimixs Dec 18, 2025
51dcf3a
fix
modelec-bot Dec 18, 2025
96df284
fix
modelec-bot Dec 18, 2025
c2f967a
up and down value
Ackimixs Dec 18, 2025
ca9da5b
setup joy
Ackimixs Dec 18, 2025
267d28f
servo
Ackimixs Dec 18, 2025
0b649a9
joy
Ackimixs Dec 18, 2025
344aec6
servo value
Ackimixs Dec 18, 2025
bcfdb94
servo value
Ackimixs Dec 18, 2025
507020e
servo value
Ackimixs Dec 18, 2025
6e235fe
servo value
Ackimixs Dec 18, 2025
9f6da67
servo value
Ackimixs Dec 18, 2025
bd77ccc
servo value
Ackimixs Dec 18, 2025
b802d22
servo value
Ackimixs Dec 18, 2025
94b85ff
servo value
Ackimixs Dec 19, 2025
980beaa
dist
Ackimixs Dec 19, 2025
ec7fca4
new Front Back system
Ackimixs Dec 19, 2025
eea5746
rewrite action i'm not 100% ok with it but gonna test it
Ackimixs Dec 19, 2025
8b1e263
rewrite action hope this work
Ackimixs Dec 20, 2025
c55ab84
start using a top level cmake so it's easier with CLion
Ackimixs Jan 17, 2026
d4905f3
change to real serial port
modelec-bot Jan 20, 2026
2078e8f
update mission
Ackimixs Jan 20, 2026
3c99f7a
update mission + init strat
Ackimixs Jan 21, 2026
60e361b
nav
Ackimixs Jan 21, 2026
b75bc45
nav
Ackimixs Jan 21, 2026
3c1cea0
hope it works
Ackimixs Jan 21, 2026
1481a10
hope it works
Ackimixs Jan 21, 2026
0834053
install
Ackimixs Jan 21, 2026
c085793
BackFront
Ackimixs Jan 22, 2026
b6cbb7e
start dynamic mission
Ackimixs Jan 22, 2026
fe913d5
front/back
Ackimixs Jan 23, 2026
f039b9c
front/back
Ackimixs Jan 23, 2026
9f582c2
some fix
Ackimixs Jan 23, 2026
1b3bbf7
make it work
Ackimixs Jan 23, 2026
8c605b8
fix path
Ackimixs Jan 23, 2026
3a6ac05
fix path
Ackimixs Jan 23, 2026
6bf1247
ip
Ackimixs Jan 23, 2026
775f477
remove front back but working good
Ackimixs Jan 23, 2026
184c05a
better dynamic choice
Ackimixs Jan 23, 2026
1d093ed
front/back
Ackimixs Jan 24, 2026
c4342e3
servo
Ackimixs Jan 24, 2026
101dc0a
serial action message
Ackimixs Jan 24, 2026
eb8a193
servo
Ackimixs Jan 26, 2026
11e64e2
rewrite mission for future use
Ackimixs Jan 26, 2026
57c8176
rewrite mission for future use
Ackimixs Jan 26, 2026
2a0f61c
add more things to action
Ackimixs Jan 26, 2026
556934b
add more things to action
Ackimixs Jan 26, 2026
d69d594
ask waypoint threshold
Ackimixs Jan 27, 2026
5cf0271
ask waypoint threshold
Ackimixs Jan 27, 2026
9ef5d7d
start
Ackimixs Jan 27, 2026
bb3d9e5
log
Ackimixs Jan 27, 2026
b29a6a6
step
Ackimixs Jan 27, 2026
ee06352
log
Ackimixs Jan 27, 2026
7f5150a
angle value
Ackimixs Jan 27, 2026
854afbe
static strat
Ackimixs Jan 27, 2026
e2f3304
static strat
Ackimixs Jan 27, 2026
2f2b888
message
Ackimixs Jan 27, 2026
b08cac5
static
Ackimixs Jan 27, 2026
d608eb0
static
Ackimixs Jan 27, 2026
22f2f84
static
Ackimixs Jan 27, 2026
f480c06
value
Ackimixs Jan 27, 2026
bc225bc
servo value
Ackimixs Jan 27, 2026
c1ca8da
servo value
Ackimixs Jan 27, 2026
2f68d84
angle
Ackimixs Jan 28, 2026
52d3d64
Merge branch 'develop' into develop-strat-5
Ackimixs Jan 28, 2026
f638db0
fix merge
Ackimixs Jan 28, 2026
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
2 changes: 1 addition & 1 deletion fastdds_setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<!-- End repeat -->
<locator>
<udpv4>
<address>100.113.219.4</address> <!-- ackimixs -->
<address>100.84.205.108</address> <!-- ackimixs -->
</udpv4>
</locator>
<locator>
Expand Down
2 changes: 1 addition & 1 deletion joy.ros2_launch_marcel.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Type=Application
Name=Joy
Comment=Lance le système ROS 2 avec GUI
Exec=/home/modelec/modelec-marcel-ROS/start_ros2.sh
Exec=/home/modelec/Modelec-ROS2/start_ros2.sh
Icon=utilities-terminal
Terminal=true
Categories=Utility;
2 changes: 1 addition & 1 deletion no_lidar.joy.ros2_launch_marcel.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Type=Application
Name=Joy no Lidar
Comment=Lance le système ROS 2 avec GUI
Exec=/home/modelec/modelec-marcel-ROS/start_ros2.sh with_rplidar:=false
Exec=/home/modelec/Modelec-ROS2/start_ros2.sh with_rplidar:=false
Icon=utilities-terminal
Terminal=true
Categories=Utility;
4 changes: 3 additions & 1 deletion no_lidar.ros2_launch_marcel.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
Type=Application
Name=No Lidar
Comment=Lance le système ROS 2 avec GUI
Exec=/home/modelec/modelec-marcel-ROS/start_ros2.sh with_joy:=false with_rplidar:=false

Exec=/home/modelec/Modelec-ROS2/start_ros2.sh with_joy:=false with_rplidar:=false

Icon=utilities-terminal
Terminal=true
Categories=Utility;
2 changes: 1 addition & 1 deletion ros2_launch_marcel.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Type=Application
Name=Lancer ROS 2
Comment=Lance le système ROS 2 avec GUI
Exec=/home/modelec/modelec-marcel-ROS/start_ros2.sh with_joy:=false
Exec=/home/modelec/Modelec-ROS2/start_ros2.sh with_joy:=false
Icon=utilities-terminal
Terminal=true
Categories=Utility;
4 changes: 4 additions & 0 deletions src/modelec_com/src/pcb_action_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@ namespace Modelec

relay_move_res_pub_->publish(relay_msg);
}
else if (tokens[1] == "TIR")
{
// Do nothing for now
}
else
{
RCLCPP_WARN(this->get_logger(), "Unknown message format for OK response: '%s'", trim(msg).c_str());
Expand Down
2 changes: 1 addition & 1 deletion src/modelec_strat/data/obstacles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<possible-angle theta="-1.5708" />
</Box>
<Box id="22" x="2825" y="400" theta="3.1415" width="200" height="150" type="box"/>
<Box id="23" x="1900" y="175" theta="-1.5708" width="200" height="150" type="box"/>
<Box id="23" x="1900" y="175" theta="1.5708" width="200" height="150" type="box"/>

<!-- PAMI Start -->
<Obstacle id="30" x="75" y="1750" theta="1.5708" width="150" height="450" type="pami-start"/>
Expand Down
14 changes: 7 additions & 7 deletions src/modelec_strat/include/modelec_strat/action/free_action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ namespace Modelec
{
public:
FreeAction(const std::shared_ptr<ActionExecutor>& action_executor);
FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front, int n);
FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::pair<int, bool> servo);
FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::vector<std::pair<int, bool>> servos);
FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, Front front, int n);
FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::pair<int, Front> servo);
FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::vector<std::pair<int, Front>> servos);

void Next() override;
void Init(const std::vector<std::string>& params) override;
void AddServo(int id, bool front);
void AddServo(std::pair<int, bool> servo);
void AddServos(const std::vector<std::pair<int, bool>>& servos);
void AddServo(int id, Front front);
void AddServo(std::pair<int, Front> servo);
void AddServos(const std::vector<std::pair<int, Front>>& servos);

inline static const std::string Name = ActionExec::FREE;

private:
std::vector<std::pair<int, bool>> servos_;
std::vector<std::pair<int, Front>> servos_;

std::queue<int> steps_;

Expand Down
14 changes: 7 additions & 7 deletions src/modelec_strat/include/modelec_strat/action/take_action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ namespace Modelec
{
public:
TakeAction(const std::shared_ptr<ActionExecutor>& action_executor);
TakeAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front, int n);
TakeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::pair<int, bool> servo);
TakeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::vector<std::pair<int, bool>> servos);
TakeAction(const std::shared_ptr<ActionExecutor>& action_executor, Front front, int n);
TakeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::pair<int, Front> servo);
TakeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::vector<std::pair<int, Front>> servos);

void Next() override;
void Init(const std::vector<std::string>& params) override;
void AddServo(int id, bool front);
void AddServo(std::pair<int, bool> servo);
void AddServos(const std::vector<std::pair<int, bool>>& servos);
void AddServo(int id, Front front);
void AddServo(std::pair<int, Front> servo);
void AddServos(const std::vector<std::pair<int, Front>>& servos);

inline static const std::string Name = ActionExec::TAKE;

private:
std::vector<std::pair<int, bool>> servos_;
std::vector<std::pair<int, Front>> servos_;

std::queue<int> steps_;

Expand Down
16 changes: 14 additions & 2 deletions src/modelec_strat/include/modelec_strat/action_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,28 @@ namespace Modelec

void Up(BaseAction::Front front, bool force = false);

void Take(std::vector<std::pair<int, bool>> servos, bool force = false);
void Take(const std::vector<std::pair<int, BaseAction::Front>>& servos, bool force = false);

void Free(std::vector<std::pair<int, bool>> servos, bool force = false);
void Free(const std::vector<std::pair<int, BaseAction::Front>>& servos, bool force = false);

void MoveServoTimed(const modelec_interfaces::msg::ActionServoTimedArray& msg);

void MoveServo(const modelec_interfaces::msg::ActionServoPosArray& msg);

std::array<std::shared_ptr<BoxObstacle>, 2> box_obstacles_;

bool IsEmpty() const;

bool IsFull() const;

bool HasBox(BaseAction::Front front) const;

bool HasFrontBox() const;

bool HasBackBox() const;

bool HasOneBox() const;

protected:
rclcpp::Publisher<modelec_interfaces::msg::ActionAscPos>::SharedPtr asc_move_pub_;
rclcpp::Publisher<modelec_interfaces::msg::ActionServoPosArray>::SharedPtr servo_move_pub_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ namespace Modelec {
class FreeMission : public Mission {
public:
FreeMission(const std::shared_ptr<NavigationHelper>& nav,
const std::shared_ptr<ActionExecutor>& action_executor);
const std::shared_ptr<ActionExecutor>& action_executor,
BaseAction::Front front = BaseAction::FRONT);

void Start(rclcpp::Node::SharedPtr node) override;
void Update() override;
Expand All @@ -25,7 +26,9 @@ namespace Modelec {
UP,
GO_BACK,
DONE,
} step_;
};

BaseAction::Front front_;

MissionStatus status_;
std::shared_ptr<NavigationHelper> nav_;
Expand All @@ -38,5 +41,9 @@ namespace Modelec {

rclcpp::Time go_timeout_;
rclcpp::Time deploy_time_;

std::optional<rclcpp::Time> min_time_;

rclcpp::Time last_ask_waypoint_time_;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ namespace Modelec
private:
enum Step
{
GO_FRONT,
AWAIT_95S,
GO_HOME,
DONE,

ROTATE_TO_HOME,
GO_HOME,
GO_CLOSE,
} step_;
DONE,
};

MissionStatus status_;
std::shared_ptr<NavigationHelper> nav_;
Expand All @@ -38,5 +35,9 @@ namespace Modelec
rclcpp::Publisher<std_msgs::msg::Int64>::SharedPtr score_pub_;
int mission_score_ = 0;
rclcpp::Time go_timeout_;

std::optional<rclcpp::Time> min_time_;

rclcpp::Time last_ask_waypoint_time_;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ namespace Modelec
virtual void Clear() = 0;
virtual MissionStatus GetStatus() const = 0;
virtual std::string GetName() const = 0;

protected:
std::queue<int> steps_;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ namespace Modelec {
class TakeMission : public Mission {
public:
TakeMission(const std::shared_ptr<NavigationHelper>& nav,
const std::shared_ptr<ActionExecutor>& action_executor);
const std::shared_ptr<ActionExecutor>& action_executor,
BaseAction::Front front = BaseAction::FRONT);

void Start(rclcpp::Node::SharedPtr node) override;
void Update() override;
Expand All @@ -25,7 +26,9 @@ namespace Modelec {
TAKE,
UP,
DONE,
} step_;
};

BaseAction::Front front_;

std::shared_ptr<BoxObstacle> closestBox;
MissionStatus status_;
Expand All @@ -35,5 +38,9 @@ namespace Modelec {

rclcpp::Time go_timeout_;
rclcpp::Time deploy_time_;

std::optional<rclcpp::Time> min_time_;

rclcpp::Time last_ask_waypoint_time_;
};
}
10 changes: 5 additions & 5 deletions src/modelec_strat/include/modelec_strat/navigation_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ namespace Modelec

bool HasArrived() const;

bool RotateTo(const PosMsg::SharedPtr& pos);
bool RotateTo(const Point& pos);
bool RotateTo(const PosMsg::SharedPtr& pos, bool front = true);
bool RotateTo(const Point& pos, bool front = true);
void Rotate(double angle);

int GoTo(const PosMsg::SharedPtr& goal, bool isClose = false, int collisionMask = Pathfinding::FREE);
int GoTo(int x, int y, double theta, bool isClose = false, int collisionMask = Pathfinding::FREE);
int GoTo(const Point& goal, bool isClose = false, int collisionMask = Pathfinding::FREE);

int GoToRotateFirst(const PosMsg::SharedPtr& goal, bool isClose = false, int collisionMask = Pathfinding::FREE);
int GoToRotateFirst(int x, int y, double theta, bool isClose = false, int collisionMask = Pathfinding::FREE);
int GoToRotateFirst(const Point& goal, bool isClose = false, int collisionMask = Pathfinding::FREE);
int GoToRotateFirst(const PosMsg::SharedPtr& goal, bool isClose = false, int collisionMask = Pathfinding::FREE, bool front = true);
int GoToRotateFirst(int x, int y, double theta, bool isClose = false, int collisionMask = Pathfinding::FREE, bool front = true);
int GoToRotateFirst(const Point& goal, bool isClose = false, int collisionMask = Pathfinding::FREE, bool front = true);

int CanGoTo(const PosMsg::SharedPtr& goal, bool isClose = false, int collisionMask = Pathfinding::FREE);
int CanGoTo(int x, int y, double theta, bool isClose = false, int collisionMask = Pathfinding::FREE);
Expand Down
1 change: 1 addition & 0 deletions src/modelec_strat/include/modelec_strat/strat_fms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ namespace Modelec
int team_id_ = 0;

std::queue<State> game_action_sequence_;
bool static_strat_ = false;

std::shared_ptr<NavigationHelper> nav_;
std::shared_ptr<ActionExecutor> action_executor_;
Expand Down
6 changes: 3 additions & 3 deletions src/modelec_strat/src/action/down_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ void Modelec::DownAction::Next()
{
msg.items[0].id = 0;
msg.items[0].start_angle = 1.95;
msg.items[0].end_angle = 2.95;
msg.items[0].end_angle = 3;
msg.items[0].duration_s = 1;

msg.items[1].id = 1;
msg.items[1].start_angle = 1.9;
msg.items[1].end_angle = 0.9;
msg.items[1].end_angle = 0.85;
msg.items[1].duration_s = 1;

msg.items[2].id = 2;
Expand All @@ -50,7 +50,7 @@ void Modelec::DownAction::Next()

msg.items[3].id = 3;
msg.items[3].start_angle = 2.7;
msg.items[3].end_angle = 3;
msg.items[3].end_angle = 2.9;
msg.items[3].duration_s = 1;
}

Expand Down
20 changes: 10 additions & 10 deletions src/modelec_strat/src/action/free_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ Modelec::FreeAction::FreeAction(const std::shared_ptr<ActionExecutor>& action_ex
steps_.push(ActionExec::DONE_STEP);
}

Modelec::FreeAction::FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, bool front, int n) : FreeAction(action_executor)
Modelec::FreeAction::FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, Front front, int n) : FreeAction(action_executor)
{
AddServo(n, front);
}

Modelec::FreeAction::FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::pair<int, bool> servo) : FreeAction(action_executor)
Modelec::FreeAction::FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::pair<int, Front> servo) : FreeAction(action_executor)
{
AddServo(servo.first, servo.second);
}

Modelec::FreeAction::FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::vector<std::pair<int, bool>> servos) : FreeAction(action_executor)
Modelec::FreeAction::FreeAction(const std::shared_ptr<ActionExecutor>& action_executor, std::vector<std::pair<int, Front>> servos) : FreeAction(action_executor)
{
AddServos(servos);
}
Expand All @@ -44,9 +44,9 @@ void Modelec::FreeAction::Next()

for (size_t i = 0; i < servos_.size(); i++)
{
msg.items[i].id = servos_[i].first + (servos_[i].second ? 3 : 11);
msg.items[i].start_angle = servos_[i].second ? 0.8 : 0;
msg.items[i].end_angle = servos_[i].second ? 2.5 : 0;
msg.items[i].id = servos_[i].first + (servos_[i].second ? 4 : 12);
msg.items[i].start_angle = servos_[i].second ? 3 : 0;
msg.items[i].end_angle = servos_[i].second ? 1 : 0;
msg.items[i].duration_s = 0.5;
}

Expand All @@ -71,22 +71,22 @@ void Modelec::FreeAction::Init(const std::vector<std::string>& params)
{
int id = std::stoi(params[i]);
bool front = (i + 1 < params.size()) ? (params[i + 1] == "1" || params[i + 1] == "true" || params[i + 1] == "front") : true;
AddServo(id, front);
AddServo(id, front ? FRONT : BACK);
}
}
}

void Modelec::FreeAction::AddServo(int id, bool front)
void Modelec::FreeAction::AddServo(int id, Front front)
{
servos_.emplace_back(id, front);
}

void Modelec::FreeAction::AddServo(std::pair<int, bool> servo)
void Modelec::FreeAction::AddServo(std::pair<int, Front> servo)
{
servos_.emplace_back(servo);
}

void Modelec::FreeAction::AddServos(const std::vector<std::pair<int, bool>>& servos)
void Modelec::FreeAction::AddServos(const std::vector<std::pair<int, Front>>& servos)
{
servos_.insert(servos_.end(), servos.begin(), servos.end());
}
Loading