Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fetty31 committed Jun 6, 2023
1 parent f1dee4c commit 5cefa47
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion launch/autoX.launch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<launch>

<!-- TAILORED MPC -->
<node pkg="tailored_mpc" type="tailored_mpc_exec" name="tailored_mpc" output="screen">
<node pkg="tailored_mpc" type="tailored_mpc_exec" name="tailored_mpc" output="log">
<rosparam file="$(find tailored_mpc)/params/tailored_mpc.yaml" subst_value="True"/>
</node>

Expand Down
8 changes: 4 additions & 4 deletions params/dyn_autox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ dictitems:
state: []
parent: 0
q_mu: 0.01
q_n: 150.0
q_nN: 150.0
q_n: 550.0
q_nN: 550.0
q_s: 10.0
q_sN: 10.0
q_slack_track: 1000.0
Expand All @@ -47,8 +47,8 @@ dictitems:
state: []
latency: 5
q_mu: 0.01
q_n: 150.0
q_nN: 150.0
q_n: 550.0
q_nN: 550.0
q_s: 10.0
q_sN: 10.0
q_slack_track: 1000.0
Expand Down
2 changes: 1 addition & 1 deletion params/tailored_mpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ MPC:
rk4_t: 0.025 #[s] Runge Kutta integration time
Nthreads: 5 # Number of threads

nPlanning: 1500 # n points saved from the planner
nPlanning: 2000 # n points saved from the planner
plannerAccuracy: 0.025 # [m] distance accuracy of the planner (distance between given points)
nSearchAhead: 5 # [m] distance ahead where we will look for the closer point to the car (int)
19 changes: 10 additions & 9 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ void dynamicCallback(tailored_mpc::dynamicConfig &config, uint32_t level, MPC* m

void my_SIGhandler(int sig){

if(ros::master::check()){
as_msgs::CarCommands msgCommands;
msgCommands.motor = -1.0; // no one will read this value, but what if..
msgCommands.steering = 0.0;
msgCommands.Mtv = 0.0;
for(int i=0; i<5; i++){
pubCommands.publish(msgCommands);
ros::Duration(0.05).sleep();
}
// More safe if the car keeps the last steering command sent before shutdown ???
if(ros::master::check()){
// as_msgs::CarCommands msgCommands;
// msgCommands.motor = -1.0; // no one will read this value, but what if..
// msgCommands.steering = 0.0;
// msgCommands.Mtv = 0.0;
// for(int i=0; i<5; i++){
// pubCommands.publish(msgCommands);
// ros::Duration(0.05).sleep();
// }
ROS_ERROR("MPC says Goodbye :)");
}
ros::shutdown();
Expand Down

0 comments on commit 5cefa47

Please sign in to comment.