Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/persistent service client refactor #11

Closed
wants to merge 153 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
4fe46e7
Added new time average metrics to the queues and added metrics to the…
Mar 7, 2024
0749e13
Added maintainer name in the ros_queue readme
Mar 7, 2024
df0a42c
Added the ros_queue_experiments package
Mar 7, 2024
ec7e882
Added a message for the states of the auv experiment system
etienn8 Mar 11, 2024
bd66d49
Added a state manager to simplified manipulation between the system i…
etienn8 Mar 11, 2024
0e6ea66
Added AUVStates namespace to add the transmission vector and zone con…
etienn8 Mar 11, 2024
26de59f
Added base class to hold the service server in the auv_system
etienn8 Mar 11, 2024
7c5ed11
Moved the metric_services class to a more specific directory
Mar 13, 2024
4f6021b
Removed unused constructor of the AUVStateManager
Mar 13, 2024
7fe503f
Added the renewal time prediction services
Mar 13, 2024
b096719
Fixed incorrect else if usage
Mar 13, 2024
15a34fa
Added an initial config files for the temperatures and expected times
Mar 13, 2024
1ff1868
Added temperature services
Mar 14, 2024
dd55d38
Added AUV state initialization
Mar 14, 2024
dd23569
Added methods to get the renewal time base from the current state to …
Mar 14, 2024
0c2ca52
Fixed conversion error from the bool array of ROS messages to vector<…
Mar 14, 2024
86e8f5e
Added core class of the AUV that will propogate the dynamic, holds th…
Mar 14, 2024
cc332b5
Added the main auv node
Mar 14, 2024
11e2b1f
Added localization metrics services
Mar 14, 2024
53ba895
Added the missing fetching of parameters for the real model of the te…
Mar 14, 2024
9dc3ae9
Trailing space
etienn8 Mar 14, 2024
42b1cfe
Added DualMetricServices for metrics that have arrival and departures
etienn8 Mar 14, 2024
aa72693
Added the departure services to the temperature services
etienn8 Mar 14, 2024
801cc45
Added the departure services of the localization metrics
etienn8 Mar 14, 2024
3396e1d
Added the localization target in the config file
etienn8 Mar 14, 2024
d21a6ff
Trailing spaces
etienn8 Mar 14, 2024
c78ccfe
Added TaskPublisher
etienn8 Mar 15, 2024
615f129
Added a service to indicate how many bytes could be transmitted based…
etienn8 Mar 15, 2024
f2eabc5
Added the penalty services based on the traveled distance
etienn8 Mar 18, 2024
523a9a0
trailing space
etienn8 Mar 18, 2024
72e103b
Added a pointer to the AUVSystem in the AUVStateManager
etienn8 Mar 18, 2024
41aeb50
Added the dynamic change of the metrics
etienn8 Mar 18, 2024
353a88a
Added the server to get all the potential actions in the ros_queue_ex…
etienn8 Mar 19, 2024
621cce8
Added two messages for the communication between the AUV system node …
etienn8 Mar 20, 2024
9f1a0c2
Added the action perturbation node and the CMakeList file
etienn8 Mar 20, 2024
a5c3d6f
Typo in action server name
etienn8 Mar 21, 2024
bdc8e1c
Added the service on the AUV system side to received disturbed command
etienn8 Mar 21, 2024
85284fd
Added the real renewal time service compuation
etienn8 Mar 25, 2024
e38fce0
Trailing space
etienn8 Mar 25, 2024
105454f
Added test file to manually verify that the parameters and services w…
etienn8 Mar 25, 2024
5285b5f
Changed the model to remove displacements between zones.
etienn8 Mar 25, 2024
a4e65cc
Added missing localization state updates in the AUVStates msg
etienn8 Mar 25, 2024
8ab534c
Fixed converted queue bytes that wouldn't be transmitted if the remai…
etienn8 Mar 25, 2024
4a53904
Made the ConverteRemainingMean more specific to blocked queues and no…
etienn8 Mar 25, 2024
35d6770
Removed the spinning rate of the AUVSystem node to get the fastest ca…
etienn8 Mar 25, 2024
581bcbf
Changed the action service callback system to enable the reception an…
etienn8 Mar 26, 2024
8459d6d
Fixed bug where the task that could be sent was never reset between s…
etienn8 Mar 26, 2024
5c666bd
Added the auv_state publisher and added metrics to see the proportion…
etienn8 Mar 27, 2024
c52a82d
Scaled the arrival and departures of the read metrics to have their s…
etienn8 Mar 27, 2024
ba1c636
Fixed error where localization returned the temperature
etienn8 Apr 1, 2024
0b2c16c
Fixed transmission bug where the data transmission was reduced one me…
etienn8 Apr 1, 2024
addf0c2
Added messages to get the internal costs of each action in a controll…
etienn8 Apr 2, 2024
ede9f05
Added internal controller cost topic
Apr 2, 2024
10b770f
Added a service to get the queue server stats
Apr 11, 2024
e9cee43
Added classes to monitor the time average arrivals of metrics
Apr 12, 2024
faec58e
Added the arrival performance of the localization and added the perfo…
Apr 12, 2024
986d212
Added missing localization_monitor file from last commit and added me…
Apr 12, 2024
123949f
Added the mean arrival and departure monitoring of the real queue and…
Apr 17, 2024
1c514f8
Fixed the missing publication of the controller costs for the renewal…
Apr 17, 2024
1caa5be
Added services for rate and changes for each metrics
Apr 19, 2024
869dae8
Fixed mistmatch between the trigger services request from the virtual…
Apr 19, 2024
8d8c17c
Added the real arrival and departure change for the localization and …
Apr 22, 2024
512726c
Added potential missing include files that might cause a dependency p…
Apr 22, 2024
9012222
Added the launchfile that starts a non renewal controller with no ste…
Apr 22, 2024
568bcaf
Added the queue_controller config file and the queue server config file
Apr 22, 2024
c037ac5
Added generic metric for the auv system and the config file for the p…
Apr 22, 2024
987c598
Added a action performance publisher in the disturbed action server
etienn8 Apr 23, 2024
d3e2467
Added non-periodic mode to the queue controller to start a controller…
etienn8 Apr 24, 2024
038d20b
Removed word duplication in queue controller's README
etienn8 Apr 24, 2024
77d9bba
Added real predictions of queue changes for the optimal controller co…
Apr 29, 2024
dc25e4d
Added a parameter to the disturbed action server to make dummy to rec…
Apr 30, 2024
f3cbc91
Removed unused library ros_boosted_utilities dependency
Apr 30, 2024
4271f3c
Added a synchronization mechanism for the queue controllers
Apr 30, 2024
08dfea9
Added a multi controller setup to compare the controller with expecte…
Apr 30, 2024
a5f7359
Added a wait for existence on the topic that a controller depends on …
May 1, 2024
bb1b848
Added the real expected metric of the penalty and the renewal time an…
May 1, 2024
6f87eea
Added a approximate message to synchronise the output of the controll…
May 2, 2024
bb7a6d4
Trailing space
May 2, 2024
98331fc
Remove unfinished sentence
May 2, 2024
aa8e67e
Added flag to prevent a queue controller from sending changes to a qu…
etienn8 May 3, 2024
08cdd97
Setup the multicontroller setup in the experiments so only the optima…
etienn8 May 7, 2024
29bd515
Added 5 types of experimental setup for model and action uncertainty
etienn8 May 7, 2024
ce33a66
Added a metric to see the diffirence of estimation between the server…
etienn8 May 7, 2024
42d3f85
Added the support of relative topic names for the queue controller an…
May 8, 2024
7fb552f
Removed unused file
May 8, 2024
a92c192
Added launchfile to start multiple queueing system with similar fault…
May 15, 2024
4b50eda
Added a gitgnore to prevent committing experiment results
May 15, 2024
829fda4
Changed output directory for more a convenient name
May 15, 2024
054e124
Added a rosbag recorder in the experiment launchfile that listens to …
May 15, 2024
895e66a
Added the computation of the theoretical mean the continuous metrics …
May 16, 2024
9e32d78
Made a queue_controller_utils library and added a util to know if the…
May 17, 2024
1f0b308
Exposed queue_controller_utils_lib to other packages
May 17, 2024
22d5c5c
Removed jitter and delay noise in monitoring by moving the publish au…
May 17, 2024
eb8596a
Added elapsed time in the queue server stats messages
May 20, 2024
00a4371
Added the exposition through the monitoring message of the differenc…
May 20, 2024
4affeb5
Moved the monitoring sample between the controller start even and opt…
May 20, 2024
2821758
Removed useless static variable from queue_controller
May 21, 2024
3ae9ff1
Added the controller execution time in the last renewal message and s…
May 23, 2024
1659b32
Fixed Inversted step real queue changes computation of the temperatur…
May 23, 2024
d1b2164
Added the change that happened during the last controller execution
May 23, 2024
0ed0da8
Reafactored the average means of the queue server stats to time avera…
May 23, 2024
99456d1
Moved the definitions of the MeanStats classes to a cpp to remove pot…
May 23, 2024
f45a18d
Unified estimation error by addinfg the arrival_mean of queues in ros…
May 24, 2024
bcb5698
Fixed the double integral of the renewal target for renewal system
May 24, 2024
69e9e5a
Added a aunch file to plot estimation error and control error
May 24, 2024
36176ba
Added a single controller launchfile for debugging and testing
May 24, 2024
ce155c3
Changed parameters line placement for clarity in the experiment_launcher
May 24, 2024
882591c
Changed the arriving message to a valu of 8 per seconds to put the sy…
May 27, 2024
80fab5c
Set the localization rate for the bad predictions case so its value i…
May 27, 2024
2e1049d
Removed unused files
May 27, 2024
f494648
Reduced the weight of the localization and temperature queue to remov…
May 27, 2024
bd9cf98
Added a new queue that makes the temperature to above 0 deg
May 28, 2024
252c630
Compute the monitoring of the time average queue arrival of queues wi…
May 30, 2024
51a7b1f
Added an index in the ActionPerformance message to indicate the taken…
May 30, 2024
391d088
Added missing low temp target
May 30, 2024
1556ceb
Added the penalty measurement of the controller action in addition to…
May 30, 2024
922aa0e
Added penalty monitor that measures the last value, the mean and the …
Jun 3, 2024
876ae69
Moved sources files of ros_queue_experiments to subfolders for clarity
Jun 3, 2024
4e1f69a
Added missing pragma once to an include file
Jun 3, 2024
973734f
Added a python experience manager to launch experiments for a given time
Jun 3, 2024
bc8559c
Added some scripts to launch the first experiment and read its rosbag
Jun 5, 2024
ed82b8f
Added the extraction of the metric performances and the queue server …
Jun 5, 2024
22dc1b0
Added a createCSV function to save arbitrary series in a CSV with an …
Jun 5, 2024
54440f9
Transformed all the queue_performance measurements in series
Jun 6, 2024
25a0dfe
Added the science matplotlib style
Jun 7, 2024
4d9464f
Added the python requirements
Jun 7, 2024
d7b0e93
Added the low_temperature metric performance, made the QueueEndValues…
Jun 7, 2024
16c7fe0
Fixed synchronization mechanism in queue_controller
Jun 10, 2024
1030a50
Added the persistent service client to the disturbed action server an…
Jun 11, 2024
6d2bbee
Added the reading of the queue sizes from the queue server from the d…
Jun 18, 2024
eeb9406
Typo in the syncrhonized action monitoring and adding missing control…
Jun 18, 2024
5d5b437
Adding missing building dependency for the perturbation action node
Jun 18, 2024
cae6afe
Ignore file from the Python's cache
Jun 18, 2024
ee63f64
Added the ActionSeries data structure in the python analyser
Jun 18, 2024
9b46695
Missing typo correction in header
Jun 18, 2024
2a0251b
Added a flag to prevent automatic output generation and a flag to aut…
Jun 18, 2024
77553c4
Added the action performance reading from the pertubation node
Jun 18, 2024
126448d
Added the plots for the experiment 1
Jun 18, 2024
289ea26
Adjusted action perturbation to be less agressive
Jun 19, 2024
9738ba0
Typo and add early break in a the for loop to find init time in exper…
Jun 19, 2024
208d299
Added absolute estimation error, refactored ActionSeries for ActionPe…
Jun 19, 2024
dc5dd8c
Added the second experience to see the effect of perturbations on the…
Jun 19, 2024
6e1be06
Removed unused commented code from the experiment2
Jun 19, 2024
ed94b05
Changed graph titles to indicate that we use the absolute value of es…
Jun 19, 2024
7acecce
Removed unused launchfile
Jun 19, 2024
659971a
Added the graphics of the estimation errors of the low-temperature qu…
Jun 19, 2024
1924447
Specified acquired bags for the output generation of the experiment 2…
Jun 19, 2024
66fec4f
Changed the weights of the controller to see the see the impact of t…
Jun 19, 2024
07c27be
Added the build dependencies to the PersistentServiceClient for the r…
Jun 20, 2024
a39ee79
Changed all the service client from the ros_queues for persistent client
Jun 20, 2024
8d5f15f
Refactored the service client of the QueueController for persistent s…
Jun 20, 2024
beca71e
Updated READMEs to include ros_boosted_utilities
Jun 20, 2024
d86532f
Added waitForExistence() on the persistent service client of the ros_…
Jun 20, 2024
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,19 @@ Here's a procedure on how to get started with the configurations and the launchi
- [ros_queue_msgs](https://github.com/etienn8/ros_queuing_system/tree/main/ros_queue_msgs) (ROS messages and services used as interface for the ros_queuing system, included already in the ros_queuing_system repo).
- [ros_queue_msgs](https://github.com/etienn8/ros_queuing_system/tree/main/ros_queue_msgs) (Implementation examples and dummy stochastic services to test the system, included already in the ros_queuing_system repo).
- [rosparam_utils](https://github.com/etienn8/rosparam_utils) (Tools to fetch rosparams more easily. Not directly dependent but some dependent packages need it).
- [ros_boosted_utilities](https://github.com/etienn8/ros_boosted_utilities) (Contains persistent ROS service clients to make the interfaces between the system faster.)
##### Optional
- [Catkin tools](https://catkin-tools.readthedocs.io/en/latest/#)(Tools to help build all the packages in parallel and to test the system)
- Follow their [installation](https://catkin-tools.readthedocs.io/en/latest/installing.html) and [initialization](https://catkin-tools.readthedocs.io/en/latest/quick_start.html) guide before building this package.


#### Building

To build from source, clone the [rosparam_utils](https://github.com/etienn8/rosparam_utils) repo, clone the latest version from this repository into your catkin workspace and compile all the packages using
To build from source, clone the [rosparam_utils](https://github.com/etienn8/rosparam_utils), clone the [ros_boosted_utilities](https://github.com/etienn8/ros_boosted_utilities) repo, clone the latest version from this repository into your catkin workspace and compile all the packages using

cd catkin_workspace/src
git clone https://github.com/etienn8/rosparam_utils.git
git clone https://github.com/etienn8/ros_boosted_utilities.git
git clone https://github.com/etienn8/ros_queuing_system.git
cd ../
rosdep install --from-paths . --ignore-src
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 12 additions & 5 deletions queue_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ find_package(catkin REQUIRED COMPONENTS
actionlib
std_srvs
std_msgs
ros_boosted_utilities
)

## System dependencies are found with CMake's conventions
Expand Down Expand Up @@ -109,8 +110,8 @@ find_package(catkin REQUIRED COMPONENTS
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include
# LIBRARIES queue_controller
INCLUDE_DIRS include ${ros_boosted_utilities_INCLUDE_DIRS}
LIBRARIES queue_controller_utils_lib
CATKIN_DEPENDS queue_server ros_queue_msgs roscpp message_runtime std_srvs std_msgs actionlib_msgs actionlib
# DEPENDS system_lib
)
Expand All @@ -127,9 +128,9 @@ include_directories(
)

## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/queue_controller.cpp
# )
add_library(queue_controller_utils_lib
src/queue_controller_utils.cpp
)

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
Expand All @@ -151,8 +152,14 @@ add_executable(transmission_vector_queue_controller_node src/transmission_vector
## same as for the library above
add_dependencies(transmission_vector_queue_controller_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
target_link_libraries(queue_controller_utils_lib
${catkin_LIBRARIES}
)

## Specify libraries to link a library or executable target against
target_link_libraries(transmission_vector_queue_controller_node
queue_controller_utils_lib
${catkin_LIBRARIES}
)

Expand Down
68 changes: 53 additions & 15 deletions queue_controller/README.MD

Large diffs are not rendered by default.

38 changes: 35 additions & 3 deletions queue_controller/config/min_drift-plus-penalty_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,38 @@

# Indicate the type of controller. Supported types: min_drift_plus_penalty, renewal_min_drift_plus_penalty
controller_type: "min_drift_plus_penalty"
# Period between each controller optimization process. Only used for the min_drift_plus_penalty type of controller. Float value.

# If set to true, the controller will start a new control loop once the last control loop is finished. If set to
# false, the controler will wait to for a service call to start_control_loop or an empty topic on start_control_loop.
# Default set to true.
is_periodic: true

# Period between each controller optimization process. Only used for the min_drift_plus_penalty type of controller.
# Not used if the parameter is_periodic is set to false. Float value.
time_step: 0.1
# If set to false, the controller will find an optimal next action to take and then update the virtual queues based
# on that optimal solution. If set to true, the controller will update the virtual queues based on the current of
# state of the system then find an optimal next action. Default: set to false
inverse_control_and_steps: false

# If set to true, the controller will trigger or send changes to the queue server base on the flag inverse_control_and_steps.
# If set to false, the controller will not send any changes to the specified queue_server_name. Its used if the user wants
# to implement another mecanism to change the virtual queues in queue server or to run multiple controller in parallel
# for the same queue server where only one of them is sending changes and not the others. Default: set to true.
responsible_for_virtual_queue_changes: true

# When true, a topic will be published name "controller_costs" that will output the cost of each action
# and each internal metric of the actions. Default is set to false.
measure_cost: false

# Renewal timing parameters.
# Minimum time for the renewal process. The controller will not start before that time even if the action is reached.
# The action reached is triggered by a message to a goal_reached topic. Only used if the controller is of type renewal_min_drift_plus_penalty
# Seconds in float value.
min_renewal_time: 0.0
# Maximum time for the renewal process. The controller will start a new control step even if the action isn't reached.
# The action reached is triggered by a message to a goal_reached topic. Only used if the controller is of type renewal_min_drift_plus_penalty
# The action reached is triggered by a message to a goal_reached topic. Only used if the controller is of type renewal_min_drift_plus_penalty and
# the parameter is_periodic is set to true.
# Seconds in float value.
max_renewal_time: 2.0

Expand Down Expand Up @@ -71,4 +89,18 @@ v_parameter: 1.0
# If set to true, the controller will optimize the ratio of the time average penalty over the expected renewal frame duration.
# If set to false, the controller will optimize the time average penalty.
# Only used for the renewal_min_drift_plus_penalty type of controller.
is_penalty_renewal_dependent: false
is_penalty_renewal_dependent: false

# ====== Multi controller synchronization.======
# Flag that indicate if this controller should wait for another controller to finish its optimization before sending
# action and sending the virtual changes to a queue server. Also publish a topic called controller_started and another called optimization_done
# Default is set to false.
part_of_multicontroller_synchronization: true
# Topic starts a control loop when called. A called to the topic start_control_loop is the same as calling this topic.
# Mainly used to be connected on a control_loop_started topic of another controller in a multicontroller scenario.
# It's not used if the parameter is_periodic is set to true.
start_control_loop_sync_topic: ""
# Topic of the controller that this controller depends on. It can connect to a optimization_done topic of another controoler.
# It will not be called if part_of_multicontroller_synchronization is false. Leaving it empty means the
# controller is not dependent on another controller.
dependent_on_controller_topic: ""
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
#include "ros_queue_msgs/PotentialTransmissionVectorSet.h"
#include "ros_queue_msgs/PotentialTransmissionVectorSpaceFetch.h"
#include "ros_queue_msgs/TransmissionVectorAction.h"
#include "ros_queue_msgs/TransmissionVectorControllerCostsList.h"


typedef ros_queue_msgs::MetricTransmissionVectorPredictions METRIC_CONTROL_PREDICTION_SRV;
typedef ros_queue_msgs::PotentialTransmissionVectorSet POTENTIAL_ACTION_SET_MSG;
typedef ros_queue_msgs::PotentialTransmissionVectorSpaceFetch POTENTIAL_ACTION_SET_SRV;
typedef ros_queue_msgs::TransmissionVectorAction ACTION_LIB_OUTPUT_TYPE;
typedef ros_queue_msgs::TransmissionVectorGoal ACTION_LIB_OUTPUT_GOAL_TYPE;
typedef ros_queue_msgs::TransmissionVectorGoal ACTION_LIB_OUTPUT_GOAL_TYPE;
typedef ros_queue_msgs::TransmissionVectorControllerCostsList CONTROLLER_COSTS_LIST_TYPE;
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@

#include "ros/ros.h"

#include "ros_queue_msgs/FloatRequest.h"

#include "ros_boosted_utilities/persistent_service_client.hpp"

using std::string;

/**
* @brief Structure that contains all the necessary parameters about a queue that the controller
* needs to evaluate its changes and compute the best action.
*/
template <typename TMetricControlPredictionSrv>
struct ControllerQueueStruct
{
/**
Expand Down Expand Up @@ -58,28 +63,28 @@ struct ControllerQueueStruct
* of the system and a given potential action. Should not be defined if arrival_based_on_queue_size_service_
* is used. If both are defined, expected_arrival_service_ will be used.
*/
ros::ServiceClient expected_arrival_service_;
PersistentServiceClient<TMetricControlPredictionSrv> expected_arrival_service_;

/**
* @brief ROS Service used to compute the expected departures of a queue based on a the current state
* of the system and a given potential action. Should not be defined if departure_based_on_queue_size_service_
* is used. If both are defined, expected_arrival_service_ will be used.
*/
ros::ServiceClient expected_departure_service_;
PersistentServiceClient<TMetricControlPredictionSrv> expected_departure_service_;

/**
* @brief ROS Service used to get a a metric thas is independant from the action. Should not be defined
* if expected_arrival_service_ is used. If both are defined, expected_arrival_service_ will be used.
* @details Since it uses a different service definition compared to expected_arrival_service_ because
* the latter uses a potential action as an input, arrival_independant_from_action_service_ need to be created.
*/
ros::ServiceClient arrival_independent_from_action_service_;
PersistentServiceClient<ros_queue_msgs::FloatRequest> arrival_independent_from_action_service_;

/**
* @brief ROS Service used to get a current queue size if it's used as the departure metric. Should not be defined
* if expected_departure_service_ is used. If both are defined, expected_departure_service_ will be used.
* @details Since it uses a different service definition compared to expected_departure_service_ because
* the latter uses a potential action as an input, departure_independant_from_action_service_ need to be created.
*/
ros::ServiceClient departure_independent_from_action_service_;
PersistentServiceClient<ros_queue_msgs::FloatRequest> departure_independent_from_action_service_;
};
Loading
Loading