Skip to content

Modular and configurable skill example implementation

Notifications You must be signed in to change notification settings

DavidCastro21/diet_skill

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Diet Estimation Example Implementation

Creative Commons License

Author: João Pedro Carvalho de Souza

Index

1. Overview

This package is an example package on how implement a ROS Action Skill implementation orientated to modularity and configurability. This examples takes into consideration ros, actionlib, C++ inheritance and polymorphisms, therefore the following prerequisites should be take place before the package study:

2. Example Overview

This examples relies on help nutritionist choose the best food to a patient according to a sequence of heuristics which can be defined into a pipeline structure.

alt text

Diet estimation pipeline.

2.1. Setup package

2.1. Candidates dataset

The candidate.yaml is defined by patient and describes the feasible food candidate choices. One file per patient is necessary and are provided by /patient_name_candidates.yaml. The dataset file orders the candidates by suffix index, e.g., candidate_n is the n-th candidate. An example can be verified here:

2.2. Pipeline definition

Definition of the diet estimation pipeline cascade. One file per object ordering the estimation heuristics by prefix index, e.g., n_heuristic is the n-th grasp heuristic. The prefix must be one alphanumeric digit. At least one heuristic must be defined. The example bellow set a pipeline with Protein Scorer -> Fiber Sorer workflow of costs:

pipeline:
    0_protein_scorer:
        weight: 1
        threshold: 10 #in grams
    1_fiber_scorer:
        weight: 3
        threshold: 1 #in grams

2.3. Heuristics

2.3.1. Protein scorer

Select the bast candidate by amount of protein in grams. If any value is under the threshold value, the candidate is automatically removed. Parameter list:

  • threshold: threshold value in grams to eliminate candidate.
  • weight: a scalar value of heuristic importance. Bigger value, more this heuristic affect the overall result.

2.3.2. Fiber scorer

Select the bast candidate by amount of fiber in grams. If any value is under the threshold value, the candidate is automatically removed. Parameter list:

  • threshold: threshold value in grams to eliminate candidate.
  • weight: a scalar value of heuristic importance. Bigger value, more this heuristic affect the overall result.

4. How to run

In the terminal execute the server by typing:

roslaunch diet_estimation_skill_server run.launch

Call the goal to "Fulano" patient:

rostopic pub /DietEstimationSkill/goal diet_estimation_skill_msgs/DietEstimationSkillActionGoal "header:
  seq: 0
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
goal_id:
  stamp:
    secs: 0
    nsecs: 0
  id: ''
goal:
  operation_mode: 0
  name: 'fulano'"

Check the result by:

rostopic echo /DietEstimationSkill/result

About

Modular and configurable skill example implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 95.7%
  • CMake 4.3%