Skip to content

Commit

Permalink
HuberoConfig & SocialConductor - added As param configurable in…
Browse files Browse the repository at this point in the history
… real-time
  • Loading branch information
rayvburn committed May 27, 2022
1 parent a0bec6b commit d4c0a9a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions cfg/HuberoPlanner.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ group_fis = gen.add_group("FIS", type="tab")

group_fis.add("force_factor", double_t, 0, "Factor to multiply resultant human action force with", 30.0, 0.0, 100.0)
group_fis.add("human_action_range", double_t, 0, "Distance at which any human action force fade completely", 8.0, 0.0, 10.0)
group_fis.add("as", double_t, 0, "Levelling factor that also directly affects amplitude of the resultant force", 1.1865, 0.0, 10.0)

# Trajectory generation group parameters
group_traj = gen.add_group("Trajectory", type="tab")
Expand Down
11 changes: 11 additions & 0 deletions include/hubero_local_planner/fuzz/social_conductor.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class SocialConductor {
/// \brief Updates internal state according to a given structure's content
void initialize(std::shared_ptr<const hubero_local_planner::FisParams> cfg);

/// \brief Updates parameter(s)
void setEquationParameters(double as);

/// \brief Evaluates force factor (from given `cfg`) to check if FIS calculations make sense
bool areFuzzyBehavioursDisabled() const;

Expand Down Expand Up @@ -70,6 +73,11 @@ class SocialConductor {
/// \return
std::string getBehaviourActive() const;

/// \brief Retrieves As parameter
double getParameterAs() const {
return As_;
}

/// \brief Destructor
virtual ~SocialConductor() = default;

Expand All @@ -95,6 +103,9 @@ class SocialConductor {
const double& speed_agent,
const double& speed_obstacle
);

/// \brief Levelling factor
double As_;
};

} /* namespace fuzz */
Expand Down
2 changes: 2 additions & 0 deletions include/hubero_local_planner/hubero_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ namespace hubero_local_planner {
double force_factor = 1.0;
/// Distance at which any created human action force fade completely
double human_action_range = 4.0;
/// Levelling factor that also directly affects amplitude of the resultant force
double as = 1.1865;
};

/**
Expand Down
6 changes: 5 additions & 1 deletion src/fuzz/social_conductor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ void SocialConductor::initialize(std::shared_ptr<const hubero_local_planner::Fis
cfg_ = cfg;
}

void SocialConductor::setEquationParameters(double as) {
As_ = as;
}

bool SocialConductor::areFuzzyBehavioursDisabled() const {
if (cfg_ == nullptr) {
return true;
Expand Down Expand Up @@ -51,7 +55,7 @@ bool SocialConductor::computeBehaviourForce(
// scale force vector with relevant factors
double membership_factor = fis_outputs_v.at(i).membership;
double geom_factor = computeBehaviourStrength(dist_v.at(i), speed_agent, speeds_v.at(i));
behaviour_force_ += v_temp * membership_factor * geom_factor * INTERACTION_STRENGTH_LEVELLING_FACTOR;
behaviour_force_ += v_temp * As_ * membership_factor * geom_factor * INTERACTION_STRENGTH_LEVELLING_FACTOR;

updateActiveBehaviour(fis_outputs_v.at(i).term_name);
}
Expand Down
1 change: 1 addition & 0 deletions src/hubero_config_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void HuberoConfigROS::reconfigure(HuberoPlannerConfig& cfg) {

fis_->force_factor = cfg.force_factor;
fis_->human_action_range = cfg.human_action_range;
fis_->as = cfg.as;

limits_->acc_lim_theta = cfg.acc_lim_theta;
limits_->acc_lim_x = cfg.acc_lim_x;
Expand Down

0 comments on commit d4c0a9a

Please sign in to comment.