Skip to content
Snippets Groups Projects
Commit 4c790905 authored by Alejandro Lopez Gestoso's avatar Alejandro Lopez Gestoso
Browse files

Fixed some minor errors

parent 753b12e5
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -326,7 +326,7 @@ class CDynamixel_Pan_Tilt
void set_moving_state_pan(Torque_moving_state tms);
/**
* \brief Function to get a value on pan's moving state.
* \brief Function to get the value of pan's moving state.
*
* \param tms The variable to save the value of the pan's moving state.
*/
......@@ -340,7 +340,7 @@ class CDynamixel_Pan_Tilt
void set_moving_state_tilt(Torque_moving_state tms);
/**
* \brief Function to get a value on tilt's moving state.
* \brief Function to get the value of tilt's moving state.
*
* \param tms The variable to save the value of the tilt's moving state.
*/
......@@ -353,7 +353,7 @@ class CDynamixel_Pan_Tilt
*
* \return The hysteresis angle for the pan servo.
*/
double get_checking_hysteresis_pan(double effort);
double calculate_checking_hysteresis_pan(double effort);
/**
* \brief Function to calculate the angle hysteresis depending on the desired effort for the tilt servo.
......@@ -362,7 +362,35 @@ class CDynamixel_Pan_Tilt
*
* \return The hysteresis angle for the tilt servo.
*/
double get_checking_hysteresis_tilt(double effort);
double calculate_checking_hysteresis_tilt(double effort);
/**
* \brief Function to get the value of pan's hysteresis.
*
* \param hyst The variable to save the value.
*/
void get_checking_hysteresis_pan(double &hyst);
/**
* \brief Function to get the value of tilt's hysteresis.
*
* \param hyst The variable to save the value.
*/
void get_checking_hysteresis_tilt(double &hyst);
/**
* \brief Function to set the value of pan's hysteresis.
*
* \param hyst The value to set.
*/
void set_checking_hysteresis_pan(double hyst);
/**
* \brief Function to set the value of tilt's hysteresis.
*
* \param hyst The value to set.
*/
void set_checking_hysteresis_tilt(double hyst);
public:
......@@ -534,6 +562,20 @@ class CDynamixel_Pan_Tilt
*/
void stop(void);
/**
* \brief Function to get the current speed of both servos in degrees/s.
*
* \return A struct with the current speed of both servos in degrees/s.
*/
Dynamixel_pan_tilt_data get_current_speed(void);
/**
* \brief Function to get the current effort of both servos in %.
*
* \return A struct with the current effort of both servos in %.
*/
Dynamixel_pan_tilt_data get_current_effort(void);
/**
* \brief Function to get the compliance configuration of both servos.
*
......@@ -574,6 +616,16 @@ class CDynamixel_Pan_Tilt
* \param data The data to be printed.
*/
void print_pan_tilt_data(Dynamixel_pan_tilt_data data);
};
/**
* \brief Overload of the << operator to print easily any pan-tilt data.
*
* \param out The output stream.
* \param data The data to be printed.
* \return The output stream.
*/
std::ostream& operator<< (std::ostream& out, Dynamixel_pan_tilt_data &data);
#endif
......@@ -234,7 +234,8 @@ int main(int argc, char *argv[])
desired_pos.pan = -80.1613;
desired_pos.tilt = -80.1613;
std::cout << "Desired position: ";
pan_tilt->print_pan_tilt_data(desired_pos);
std::cout << desired_pos;
//pan_tilt->print_pan_tilt_data(desired_pos);
std::cout << "Current position: ";
pan_tilt->print_current_position();
pan_tilt->move_absolute_angle(desired_pos, desired_speed);
......@@ -256,7 +257,8 @@ int main(int argc, char *argv[])
}
std::cout << "Desired position: ";
pan_tilt->print_pan_tilt_data(desired_pos);
std::cout << desired_pos;
//pan_tilt->print_pan_tilt_data(desired_pos);
std::cout << "Reached position: ";
pan_tilt->print_current_position();
std::cout << "Error position: (" << pos.pan - desired_pos.pan << " , " << pos.tilt - desired_pos.tilt << ")" << std::endl;
......@@ -285,7 +287,8 @@ int main(int argc, char *argv[])
pan_tilt->print_current_position();
std::cout << "Desired effort: ";
pan_tilt->print_pan_tilt_data(desired_effort);
std::cout << desired_effort;
//pan_tilt->print_pan_tilt_data(desired_effort);
pan_tilt->move_torque(desired_effort);
......@@ -331,7 +334,8 @@ int main(int argc, char *argv[])
pan_tilt->move_relative_angle(desired_pos,desired_speed);
std::cout << "Desired angle: ";
pan_tilt->print_pan_tilt_data(desired_pos);
std::cout << desired_pos;
//pan_tilt->print_pan_tilt_data(desired_pos);
std::cout << "Moving..." << std::endl;
......@@ -353,7 +357,8 @@ int main(int argc, char *argv[])
}
std::cout << "Desired position: ";
pan_tilt->print_pan_tilt_data(desired_pos);
std::cout << desired_pos;
//pan_tilt->print_pan_tilt_data(desired_pos);
std::cout << "Reached position: ";
pan_tilt->print_current_position();
std::cout << "Error position: (" << pos.pan - desired_pos.pan << " , " << pos.tilt - desired_pos.tilt << ")" << std::endl;
......@@ -382,7 +387,8 @@ int main(int argc, char *argv[])
pan_tilt->print_current_position();
std::cout << "Desired effort: ";
pan_tilt->print_pan_tilt_data(desired_effort);
std::cout << desired_effort;
//pan_tilt->print_pan_tilt_data(desired_effort);
pan_tilt->move_torque(desired_effort);
......
......@@ -7,7 +7,7 @@
<temp_limit>85</temp_limit>
<max_voltage>19</max_voltage>
<min_voltage>6</min_voltage>
<max_torque>100</max_torque>
<max_torque>20</max_torque>
<cw_comp_margin>2</cw_comp_margin>
<ccw_comp_margin>2</ccw_comp_margin>
<cw_comp_slope>64</cw_comp_slope>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment