Skip to content

Commit

Permalink
Merge pull request #79 from ARC-OPT/add_minor_functions
Browse files Browse the repository at this point in the history
Add some minor functionality
  • Loading branch information
dmronga authored Aug 17, 2023
2 parents 783203d + e587aed commit f9e631b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/core/RobotModelConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class ActiveContact{
}
ActiveContact(int active, double mu) : active(active), mu(mu){

}
ActiveContact(int active, double mu, double wx, double wy) : active(active), mu(mu), wx(wx), wy(wy){

}
int active; /** In contact*/
double mu; /** Friction coeffcient*/
Expand Down
7 changes: 7 additions & 0 deletions src/core/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ void Scene::sortTaskConfig(const std::vector<TaskConfig>& config, std::vector< s
}
}

uint Scene::getNTaskVariables(const std::vector<TaskConfig> &config){
uint n_task_variables = 0;
for(const TaskConfig& cfg : config)
n_task_variables += cfg.nVariables();
return n_task_variables;
}

std::vector<int> Scene::getNTaskVariablesPerPrio(const std::vector<TaskConfig> &config){

std::vector< std::vector<TaskConfig> > sorted_config;
Expand Down
5 changes: 5 additions & 0 deletions src/core/Scene.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ class Scene{
*/
static void sortTaskConfig(const std::vector<TaskConfig>& config, std::vector< std::vector<TaskConfig> >& sorted_config);

/**
* @brief Return number of tasks per priority, given the task config
*/
static uint getNTaskVariables(const std::vector<TaskConfig>& config);

/**
* @brief Return number of tasks per priority, given the task config
*/
Expand Down
2 changes: 1 addition & 1 deletion src/core/TaskConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class TaskConfig {
/** Unique identifier of the constraint. Must not be empty*/
std::string name;

/** Constraint type, can be one of 'jnt' (joint space) or 'cart' (Cartesian) */
/** Task type, can be one of 'jnt' (joint space) or 'cart' (Cartesian) */
TaskType type;

/** Priority of this task. Must be >= 0! 0 corresponds to the highest priority. */
Expand Down

0 comments on commit f9e631b

Please sign in to comment.