HLR  0.0.1
Public Member Functions | List of all members
HLR::Simulation::VirtualServo Class Reference

VirtualServo is used to simulate realistic movement of the servo. More...

#include <VirtualServo.hpp>

Collaboration diagram for HLR::Simulation::VirtualServo:

Public Member Functions

 VirtualServo (const urdf::JointConstSharedPtr &joint_shared_ptr, const std::string &robot_description)
 Constructor for VirtualServo. More...
 
void start_update_thread ()
 Starts a thread running the private function Update servo and detaches it.
 
void notify_change ()
 Sets update received to true.
 
bool is_update_received () const
 Getter for update bool. More...
 
void set_speed (double servo_speed)
 Set servo speed. More...
 
void set_target_pos (double servo_target_pos)
 Target position to move the servo. More...
 
void stop_movement ()
 Stop the servo from moving.
 
double get_current_pos () const
 Get the current position of the servo. More...
 
double get_max_speed () const
 Maximum speed of the servo. More...
 
double get_max_rad () const
 Maximum angle in radians of the servo. More...
 
double get_min_rad () const
 Minimum angle in radians of the servo. More...
 
bool is_moving () const
 Servo moving true or false. More...
 

Detailed Description

VirtualServo is used to simulate realistic movement of the servo.

Constructor & Destructor Documentation

HLR::Simulation::VirtualServo::VirtualServo ( const urdf::JointConstSharedPtr &  joint_shared_ptr,
const std::string &  robot_description 
)

Constructor for VirtualServo.

Parameters
joint_shared_ptrPointer to joints specified in urdf file
robot_descriptionName of the servo

Member Function Documentation

double HLR::Simulation::VirtualServo::get_current_pos ( ) const

Get the current position of the servo.

Returns
double get_current_pos Current position of the servo
double HLR::Simulation::VirtualServo::get_max_rad ( ) const

Maximum angle in radians of the servo.

Returns
double get_max_speed Maximum angle in radians of the servo
double HLR::Simulation::VirtualServo::get_max_speed ( ) const

Maximum speed of the servo.

Returns
double get_max_speed Maximum speed of the servo
double HLR::Simulation::VirtualServo::get_min_rad ( ) const

Minimum angle in radians of the servo.

Returns
double get_max_speed Minimum angle in radians of the servo
bool HLR::Simulation::VirtualServo::is_moving ( ) const

Servo moving true or false.

Returns
true True when servo is moving
false False when servo is not moving
bool HLR::Simulation::VirtualServo::is_update_received ( ) const

Getter for update bool.

Returns
true True when update is true
false False when update is false
void HLR::Simulation::VirtualServo::set_speed ( double  servo_speed)

Set servo speed.

Parameters
servo_speedSpeed of the servo
void HLR::Simulation::VirtualServo::set_target_pos ( double  servo_target_pos)

Target position to move the servo.

Parameters
servo_target_posPosition value

The documentation for this class was generated from the following file: