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

Conversation

etienn8
Copy link
Owner

@etienn8 etienn8 commented Jun 20, 2024

Added persistent service clients to the queue server and changed the persistent mechanism of the queue controller for the new PersistentServoceClient.

Udpated the readmes

Etienne and others added 30 commits March 7, 2024 11:16
… virtual queues.

- Updated READMEs to reflects changes to the QueueStats message definitions
- Added a real_departure_mean field to the QueueStats msg  so we have the departure means that represents the data that we could transmit and we now have a way to know how much data was actually transmitted. It provides a tool know how far from instability our system is.
- Added a change_mean filed to the QueueStats msg to have an indicator to see if the systeme converged and if the means is at zero.
- Added a new update() method to the DynamicVirtualQueue to be able to add the statistics measurement before update the actual queue.
- Added the metric computation in the DynamicVirtualQueues and adapted the departure computation in the DynamicConvertedQueue to have the real departure and the departure computation.
- Added the real depature and change metric computation in the MeanStats class.
- Adapated the queue server to initialize the flag to compute statistics in all the queues and populated the new entries from the QueueStats message in its publication.
- Fixed a confusing log whenever a virtual queue is create ("virtual real queue" -> "virtual queue")
This package is added to validate the performances of the queue controller and queue size estimation in a system with perturbations.
- Added the virtual queue's real metrics, the current penalty and the current_zone of the system.
-Added the MetricServices class to serve has a base class for the metrics that needs to be fetched by the system.
- The has a pointer towards  a AUVStateManager to have an interface to get the current state of the system via the getCurrentStates() method.
- Four callbacks are defined. Two of them are used as the service callback and they each call a virtual method that will need to be overridden by a child class.
- In the callback, two of them is linked to the real measure of the metric will the other one is the service to get a predicted value of the metric for given actions.
There will be a lot of metrics so it helps to place all the metrics together to be more convenient.
- Added a new value in the enumeration of the AUVStates::Zones to know the number of zones. It helps to create the array for mapping the time transition between two zones.
- Added the RenewalTimeServices class to hold the services that will be called to get the expected renewal time.
- The RenewalTimeServices fetches two models for the transition times: one for the real time and the other for the predicted and probably noisy times.
- Added two methods to get the renewal times mainly for the manager and the other metrics internally (getRealRenewalTimeWithStateTransition() and getPredictedRenewalTimeWithStateTransition()).
- Changed the base class of the TemperatureServices to usethe DualMetricServices.
- Refactored the name of the function to be mapped to the arrival callback of the base class.
- Added a parameter and its fetch for the target of the metric (which is also the departure value).
- Changed the base class of the LocalizationServices to the DualMetricServices to have the arrival and departure services.
- Refactored the callbacks to be used has the arrivals services and added the departure callbacks
- Added a new parameter and is fetch that represents the localization target of the controller (also represents the departure of the queue)
- Added the TaskPublisher class that holds a ROS publisher that publishes fictive tasks and that holds services to the expected values of the actions.
- For the expected value of the arrival and the departure, the expected renewal time is used to scale the numbers of task that could be done. Therefore, a pointer to the renewal service was added.
- Added the parameters in the config file for the arrival of tasks per second and the expected departure for each zone.
- Update the AUVSystem to instantiate the TaskPublisher
- Added the real and the expected distances to traveled in the configuration file that indicates the penalty of going from one zone to another
- Adapted the AUVSystem to instantiate the penalrty services.
- Added the PenaltyServices class to hold the penalty services.
- Added the last zone that the robot was at the last control step and the transition completion between two zones in the AuvStates message. Those are useful to know where the robot is coming from and where its going to know the right penalty while the robot is doing its transition. The transition_completion shows from a scale from 0.0 to 1.0 how close the robot is from arriving to the final state. It's used to know the distance traveled between controller steps.
Etienne added 29 commits June 7, 2024 13:46
… in Series and added CSV in experiment 1

- Fixed a typo in temperature
- Fixed the missing .values for the real_queue_stats in the experiment 1
- The signal to indicate that the controller has finished was sent before waiting for the signal. Therefore the depending controller could start before its dependent controller could send its action.
…d added its dependency.

Since the disturbed action  server made two service calls in its callback whenever it received an action, it slowed down the publication of the action performance. That delay caused some synchronization problems and added more delay for other topics that subscribed from it.
- Added the dependency on a PersistentServiceClient from another repo named ros_boosted_utilities
- Added the dependencies to this package
- Adjusted the build process to get this new repo
…istruber action server

Initialy the synchronized topic from the disturbed action server and from the optimal controller's action were used for the logging of the graphs. However, it was discovered that the synchronization through the message filter package was delayed by a whole cycle compared to the queue server. It was thus not usable for a graph of the queue size and the taken action. Instead of trying to remove this delay, this commit add a patch by addind the reading of the queue server when the action of the disturbed is published.
- This data structure is used to hold all the needed metrics linked to the ActionPerformance actions and also the queue server stats synnchronized with the action.
- Added an enum for the different type of actions and to simplified resolution of the actions in the code
…omatically find a init time from the bag

- Overall, this commit is to give more flexibility in experiment manager to run the experiment or to just produce the outputs based on a given bag. Those manipulation must be done by commenting some code.
- Added an argument in the execute() method of the experiment 1 definition to prevent the analyser to generate its output. I was added to let the experiment manager to decide when and how to call the output generation of the analyser.
- Added two arguments to the generatOutput method.
-- The first one, bag_name, allows the specify the name of the bag to be used. For example, if we don't want to run the experiment but just the output generation on a given bag, we can manually specified the bag's name.
-- The second added argument, base_init_time_on_first_value, allows to find the find the initial time from the fist timestamp of the server_stats messages. This topic is used since it's been published at a faster rate that the other topics.
- Replaced the end values of the queue server from the action_performance messages.
- Output the queue sizes from the action performane message to the csv
- Added the listening of the optimization_done and control_loop_started for debugging some timings
- Added the plot of a all the arrival and departure mean over time of a normal setup of a min drift plus penalty controller
- Added the plot of queue sizes with the different actions to show that the controller "sacrifices" a queue for a moment to serve another queue.
…rformanceSeries and added action type utilities

- Added a series to represent the absolute estimation error between the real continuous mean and the queue server estimated mean.
- Added two utilities function to convert a Series of action to a Series of string with the name of the action. This is for a future action list conversions for CSVs.
- Refactored ActionSeries to ActionPerformanceSeries to removed confusion of the function arguments of the 2 new utilities functions.
- Added a new Series in the ActionPerformanceSeries to represent the difference in action between the target and applied actions.
… min drift plus penalty

The second experience runs two sub experiment: 1) An experiment of the min drift plus penalty (NoRew_NoInv) in perfect conditions and 2) an experiment of the same NoRew_NoInv with perturbation on its actions. The goal is to demonstrate graphically  that there is a greater error in the estimation with perturbations.

- Added a new Experiment2Instance class in the experiment_instance, which runs two experiments one after the other. The frist one in the situtation and the other one, with perturbation.
- Added a new experiment2_definition script to define the topics to record with rosbag, to fetch the data based on the two rosbag produced by the Experiment2Instance and to output the two graphs of estimation error and target error for the localization and temperature.
…eue and the real queue to the experiment 2
…os_queues and updated building documentation

- Added the ${ros_boosted_utilities_INCLUDE_DIRS} in the include of the catkin_package of the ros_queue since the persistent service class is a template and the ros_queue libraries doesn't build anything (since they are mainly templates). Thus, the package that depends on ros_queue will now also include the header files to build the persistent client template.
…ervice client

The QueueController already implemented a kind of persistent service through a persistent connection check function called before calling the service. To have a more uniform code, this check has been replaced by changing the ros::ServiceClient by PersistentServiceClient classes.
@etienn8 etienn8 closed this Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant