From fc59eeac6f6cc2d911fb42bb527b14bbc9349652 Mon Sep 17 00:00:00 2001 From: Tomas Baca Date: Tue, 30 Jul 2024 18:20:48 +0200 Subject: [PATCH] fixed input initialization after loading parameters --- .../mrs_multirotor_simulator/uav_system/multirotor_model.hpp | 3 ++- include/mrs_multirotor_simulator/uav_system/uav_system.hpp | 5 +++++ tmux/standalone/session.yml | 1 - tmux/standalone_400_uavs/session.yml | 1 - 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/mrs_multirotor_simulator/uav_system/multirotor_model.hpp b/include/mrs_multirotor_simulator/uav_system/multirotor_model.hpp index 70a3c7f..c4ef9ef 100644 --- a/include/mrs_multirotor_simulator/uav_system/multirotor_model.hpp +++ b/include/mrs_multirotor_simulator/uav_system/multirotor_model.hpp @@ -128,9 +128,10 @@ class MultirotorModel { ModelParams getParams(void); void setParams(const ModelParams& params); -private: void initializeState(void); +private: + void updateInternalState(void); MultirotorModel::State state_; diff --git a/include/mrs_multirotor_simulator/uav_system/uav_system.hpp b/include/mrs_multirotor_simulator/uav_system/uav_system.hpp index 71c1fb6..0e67d33 100644 --- a/include/mrs_multirotor_simulator/uav_system/uav_system.hpp +++ b/include/mrs_multirotor_simulator/uav_system/uav_system.hpp @@ -136,12 +136,17 @@ UavSystem::UavSystem(const MultirotorModel::ModelParams& model_params) { multirotor_model_.setParams(model_params); + multirotor_model_.initializeState(); + initializeControllers(); } UavSystem::UavSystem(const MultirotorModel::ModelParams& model_params, const Eigen::Vector3d spawn_pos, const double spawn_heading) { multirotor_model_.setParams(model_params); + + multirotor_model_.initializeState(); + multirotor_model_.setStatePos(spawn_pos, spawn_heading); initializeControllers(); diff --git a/tmux/standalone/session.yml b/tmux/standalone/session.yml index a8bc71c..7858a43 100644 --- a/tmux/standalone/session.yml +++ b/tmux/standalone/session.yml @@ -5,7 +5,6 @@ socket_name: mrs attach: false tmux_options: -f /etc/ctu-mrs/tmux.conf # you can modify these -pre_window: export UAV_NAME=uav1; export RUN_TYPE=simulation; export UAV_TYPE=x500 startup_window: goto windows: - roscore: diff --git a/tmux/standalone_400_uavs/session.yml b/tmux/standalone_400_uavs/session.yml index 990e310..288b9a3 100644 --- a/tmux/standalone_400_uavs/session.yml +++ b/tmux/standalone_400_uavs/session.yml @@ -5,7 +5,6 @@ socket_name: mrs attach: false tmux_options: -f /etc/ctu-mrs/tmux.conf # you can modify these -pre_window: export UAV_NAME=uav1; export RUN_TYPE=simulation; export UAV_TYPE=x500; export BOND=false startup_window: goto windows: - roscore: