-
Notifications
You must be signed in to change notification settings - Fork 0
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/queue server #8
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ual Queues Predictions are note needed at the storage of the queue. It should be done in the controller. So it has been removed. Also, the virtual queue are not bounded to integer size and its more appropriate to use a real number instead. - Created a IDynamicVirtualQueue interface from which all virtual queue will inherit. The update method has been changed to have a single float argument. The size of the virtual queues are in a floating value. - Adapted the InConVirtualQueue and the EqConVirtual classes to use float sizes and by removing predictions. - Adapted ROSVirtualQueue to remove predictions and use floats. Also implemented an update() method without arguments. Since virtual queues are mainly used for inequality constraints and equality constraints around a mean target value, a target metric should be given at construction. That update of the queue follows: target_metric - current_metric. The metric is computed based on a user-defined function or a ROS service. - Added the service ComputeVirtualQueueMetric.srv to give an interface to the metric computation service. - Adapted ros_queue_test and test_service node to test the virtual queue with the new update with a target metric. - Typo
Fix/virtual queue with float value
its better practice to have msgs and a package in itself to remove unnecessary dependencies towards interfaces. - Move all defined messages and services (except ReturnSentValue that's used only for testing purpose) to a ros_queue_msgs - Refactored all the inclusion of the messages and services
- Defined ROSInConVirtualQueue and ROSEqConVirtualQueue.
Since the QueueInfo will be usefull outside of the ros_queue and that it might be send as a service, the ROSQueueInfo class has been changed to a QueueInfo ROS msg in ros_queue_msgs.
Added a class ROSByteConvertedQueue similar to ROSConvertedQueue where the conversion is implicitely made by the function based on the size in byte of the given message. This class uses the topic_tools::ShapeShifter to take a generic ROS message as an input. Therefore, there's no need to know the message type at the compilation time. The classes is then restricted to use the size() method of the shapeshifter to compute the size of the message in bytes. - Added ROSByteConvertedQueue for ConvertedQueue with generic message where the conversion is made in bytes. - Added the dependency to topic_tools - Added tests to validate the constructors and bad initialization - Test of the conversion was made externally since ROS test has some difficulties to execute the subscriber callback mid test.
…he operation of transmission.
Feat/shahe shifter queue element
- Added a config template for the queues and the queue server. Queue config template should be copied inside a list of the queue server template. - The main information that is relevant in the queue is the name, the type of the queue and the name of its interfaces. - Highly subject to change.
- Added a map of three type of queues, a real queue map and two virtual ones based on if it can have a negative value or not. All those type of queues doesn't require to know the type of messages or services at compile time. Therefore, they can all be configure through config files without compilation.
Since the queue meta information is usually unique for each queue, the queue info is moved at it construction. - Adapted the test file to support the move operation. Even if we should not move the same resource multiple time, the object is already empty.
Since QueueInfo is usually unique to all ROS Queues, it's relevant to pass it by rvalue. - Adapted ROS tests so they use the move semantics for the QueueInfo. Usually, it's not good to move multiple time the same object, but its already empty in the test so its fine.
Since the ROS queues might receive the size of another queue as a metric, a standard interface to compute the size of the queue and the metrics is thus defined. Therefore, FloatRquest returns a float that could be a metric or the size of a queue. Integer sized queues need to be aware that their size will be casted as a float.
- Removed the parameter queue_name since the first attribute that contains all the other queue_parameter can be the name of the queue. - Added a real_queue example in the template. - Added comments as a remainder to put a float value to the queue max sizes.
…nfig file. - Added the instantiation of the queue_server in the queue_server_node. - Added a structure used internally to hold all the possible and expected parameters for a queue configuration. - Added the constructor where the queue_server_name is defined and where all the parameters from the config file are parsed before calling other methods that create the queues. - Added the checkAndCreateQueue that verify that all the necessary parameters to configure a queue are set and creates the queue if they are set. - Added logging at every missing parameters or unknown parameters.
- Added QueueServerState.msg to contains the indicate the state of the queue server which is mainly its queues' size. - Adapted the QueueState current_size type to float to take into account the float value of virtual queues. - Create a States.msg in the ros_queue_msgs to indicate the states of the system which is no the same as the queue's state. - Create QueueServerStateFetch for the service that wants to get the queue_server_state without using the topic.
- Added a node named distribution_services_node that advertises ROS services that sends back a random value from a given random distribution. - Added a random_sample_distribution_service_config that takes an arbitrary number of distributions and for which a service will be created. - Added the InversedCumulativeDistribution class as a common interface for all the distribution. The distribution are only stored as their inverted cumulative distribution since only this is needed to generate a random sample. - Added the InvertedPoisson class which contains the inverted cumulative distribution function of a Poisson distribution. This the only one implemented in this commit since its the most common in queuing theory. - Added a DistributionSampleService which is a ROS wrapper that creates the service around an InverseCumulativeDistribution. - Added a DistributionSampleServer which creates DistributionSampleService sbased from the configuration file and stores those services. The ROS node contains one of those server.
…tribution. - Changed the equation used in the invertedCumulativeDistributionFunction since it was an exponential equation and not poisson. Now it uses the random Poisson generator in the standard librairy. - Added a distribution_ object and a default_random_generator_ to support the use of the standard distribution library. - Added comments in the distribution config file.
…ueue controller. The queue server will have a service interface that when called, it will update all its virtual queues. Usually, it's the role of the queue controller (not implemented) to call trigger the update. However, for testing, debugging and for passing queuing system, the queue server will need to be updated in a way. Therefore, a node that calls periodically a generic empty service has been implemented. - Added periodic_update_caller_node that calls an std_srvs::Empty service with the name and rate specified in its launchfile.
…e to update virtual queues of queue_server - Added a ROS publisher that publishes periodically the queue_serve_state that comprises the queue sizes. It publishes at each spin of the queue server. - Added a periodic spin of the server where its rate is specified by rosparam. It will also be used to update the real queues late. - Added update trigger service server that triggers an update of the virtual queues whenever its called. The update of the virtual queues will make the virtual queues call their evaluation services to know by how much their queue should changes. - Replaced the use of the internal paramMatchAndParse by the same method but from rosparam_utils package. - Added the update_trigger_service_name, the server_state_topic_name and the server_spin_rate in the configuration template file of the queue server. - Added the a launchfile argument for the server_name to remove the need to duplicate its name for name resolution in the other config files.
…ions - Duplicated and adapted the configuration template of the queue_server to match the evaluation service name of the Poisson distribution services - Added a launchfile that starts a queue_server and the Poisson distributions.
Since all the type of ROSQueues share similar services a ROS node and QueueInfo, a base class was added to ease the development.
…s_queue_tests To test the real queues it's useful to generate messages with length that have a Poisson distribution. - Added a random length topic publisher class. Their length is based on a random number of int that are placed in a vector. So the message size is 4 bytes ( 1(because of the vector pointer) + random number of integers) - Adapted the distribution service node and server to publish periodically the random length topics. - Adapted the parameter fetch to read the new distribution parameters. It uses the same structure as the services but instead of having a service name, it's a topic name.
…e publisher rate of ros_queue_tests - Decoupled the periodic calls to the serverSpin of the DistributionSampleServer from the ROS:Spin with ros::Timers. It allows the callbacks of the service to be at their maximum speed while still having a desired periodic publicationé - Added another version of the DistributionSampleService so it could use either the FloatRequest or the ByteSizeRequest as a service data structure. So it enables the services to publish random values in float or int. It's manage via a template specialization of the DistributionSampleService. - Added a new parameter in the service definition to indicate the type float or int for the service response. - Adapted the distribution_sample_server to fetch the new parameter.
…fig files. - Added the InvertedBernoulli distribution which is commonly used as a distribution for on and off transmission. - Added the parameters to configure the InvertedBernoulli distribution. - Moved the InvertedPoisson and the InvertedBernoulli in a distributions floder to separate the distributions from the other code. - Refactored the name of the config and launchfile since they don't contain anymore only Poisson distributions.
…ted evaluated by a service - Added a new service client named transmission_evaluation_service_client_ to the ROSByteConvertedQueue class that is called whenever the new method transmitBasedOnQoS() is called. The service used the ros_queue_msgs::ByteSizeRequest definition which returns an int32 value. - Added transmitBasedOnQoS() method to the real queues so it transmits data based on the available data that could be sent. This metric is given by a service. - Added a new method to the DynamicConvertedQueue to update where its transmission is given in converted size. - Adapted the parameter fetch in the queue_server to create this new service. - Added the transmitRealQueues in the serverSpin.
- srand was reset bfore each random evaluation so it restarted the seed at each iteration. However, since the time(NULL) outputs the time in second, during one second all random values were equal since the same index of a the same seed produce the same number. - Moved the srand initialization in a constructor so its set once globaly.
- The rosparam_utils directory was empty. It should be fixed so, trying to build with both directory.
Detected at automated tests.
- Added a unique name generator that is put in a queue info before being moved in the queue.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a QueueServer that:
Added ros_queue_tests that adds random distributions samples via services and topic with random sizes. Added Poisson and Bernoulli distribution.
Added a test setup of 1 stable real queue and 2 table virtual queues.
Added a periodic trigger caller to call the trigger the update of the virtual queues to use when there's no controller to do it.
Modified the ros_queue and lib_queue
A lot more has been done over those major changes. See the commit list to get more information.