1 #ifndef INCLUDE_ROTORS_CONTROL_PARAMETERS_ROS_H_ 2 #define INCLUDE_ROTORS_CONTROL_PARAMETERS_ROS_H_ 11 const std::string& key,
12 const T& default_value,
15 bool have_parameter = nh.
getParam(key, *value);
16 if (!have_parameter) {
18 <<
"/" << key <<
", setting to default: " << default_value);
19 *value = default_value;
25 std::map<std::string, double> single_rotor;
26 std::string rotor_configuration_string =
"rotor_configuration/";
28 while (nh.
getParam(rotor_configuration_string + std::to_string(i), single_rotor)) {
30 rotor_configuration->
rotors.clear();
33 nh.
getParam(rotor_configuration_string + std::to_string(i) +
"/angle",
35 nh.
getParam(rotor_configuration_string + std::to_string(i) +
"/arm_length",
37 nh.
getParam(rotor_configuration_string + std::to_string(i) +
"/rotor_force_constant",
39 nh.
getParam(rotor_configuration_string + std::to_string(i) +
"/rotor_moment_constant",
41 nh.
getParam(rotor_configuration_string + std::to_string(i) +
"/direction",
43 rotor_configuration->
rotors.push_back(rotor);
50 vehicle_parameters->
mass_,
51 &vehicle_parameters->
mass_);
54 &vehicle_parameters->
inertia_(0, 0));
57 &vehicle_parameters->
inertia_(0, 1));
61 &vehicle_parameters->
inertia_(0, 2));
65 &vehicle_parameters->
inertia_(1, 1));
68 &vehicle_parameters->
inertia_(1, 2));
72 &vehicle_parameters->
inertia_(2, 2));
void GetRosParameter(const ros::NodeHandle &nh, const std::string &key, const T &default_value, T *value)
RotorConfiguration rotor_configuration_
void GetVehicleParameters(const ros::NodeHandle &nh, VehicleParameters *vehicle_parameters)
double rotor_moment_constant
void GetRotorConfiguration(const ros::NodeHandle &nh, RotorConfiguration *rotor_configuration)
bool getParam(const std::string &key, std::string &s) const
#define ROS_WARN_STREAM(args)
std::vector< Rotor > rotors
const std::string & getNamespace() const
double rotor_force_constant