#include <motor_controller_node.h>
Public Member Functions | |
void | init () |
Initialize the mcdc3006s node. | |
MotorControllerNode (MotorDriverInterface *driver) | |
Empty constructor. | |
bool | move_abs_pos (motor_controller_msgs::MoveAbsPos::Request &req, motor_controller_msgs::MoveAbsPos::Response &resp) |
Callback to move motors by absolute position. | |
bool | move_rel_pos (motor_controller_msgs::MoveAbsPos::Request &req, motor_controller_msgs::MoveAbsPos::Response &resp) |
Callback to move motors by relative position. | |
bool | move_vel (motor_controller_msgs::MoveAbsPos::Request &req, motor_controller_msgs::MoveAbsPos::Response &resp) |
Callback to move motors in velocity. | |
void | publish () |
Publish information from the motors. | |
bool | set_cur_lim (motor_controller_msgs::Configuration::Request &req, motor_controller_msgs::Configuration::Response &resp) |
Callback to set the current limit of the motor. | |
bool | set_max_acc (motor_controller_msgs::Configuration::Request &req, motor_controller_msgs::Configuration::Response &resp) |
Callback to set the maximum acceleration of the motor. | |
bool | set_max_dec (motor_controller_msgs::Configuration::Request &req, motor_controller_msgs::Configuration::Response &resp) |
Callback to set the maximum deceleration of the motor. | |
bool | set_max_pos (motor_controller_msgs::Configuration::Request &req, motor_controller_msgs::Configuration::Response &resp) |
Callback to set the maximum position of the motor. | |
bool | set_max_vel (motor_controller_msgs::Configuration::Request &req, motor_controller_msgs::Configuration::Response &resp) |
Callback to set the maximum velocity of the motor. | |
bool | set_min_pos (motor_controller_msgs::Configuration::Request &req, motor_controller_msgs::Configuration::Response &resp) |
Callback to set the minimum position of the motor. | |
bool | set_odometry_calibration (motor_controller_msgs::Configuration::Request &req, motor_controller_msgs::Configuration::Response &resp) |
Callback to set the odometry calibration of the motor. | |
void | spin () |
Spin the node. | |
~MotorControllerNode () | |
Destructor. | |
Private Attributes | |
ros::ServiceServer | _cur_lim_srv |
ros::Publisher | _data_msg |
MotorDriverInterface * | _driver |
int | _joint_id |
std::string | _joint_name |
ros::ServiceServer | _max_acc_srv |
ros::ServiceServer | _max_dec_srv |
ros::ServiceServer | _max_pos_srv |
ros::ServiceServer | _max_vel_srv |
ros::ServiceServer | _min_pos_srv |
ros::ServiceServer | _mov_abs_pos_srv |
ros::ServiceServer | _mov_rel_pos_srv |
ros::ServiceServer | _mov_vel_srv |
ros::NodeHandle | _nh |
ros::NodeHandle | _nh_private |
ros::Publisher | _odo_msg |
ros::ServiceServer | _odo_srv |
int | _pos_factor |
ros::Rate | _publish_rate |
std::string | _serial_device |
int | _vel_factor |
Definition at line 42 of file motor_controller_node.h.
MotorControllerNode::MotorControllerNode | ( | MotorDriverInterface * | driver | ) |
Empty constructor.
Definition at line 30 of file motor_controller_node.cpp.
Destructor.
Definition at line 125 of file motor_controller_node.cpp.
void MotorControllerNode::init | ( | ) |
Initialize the mcdc3006s node.
Definition at line 132 of file motor_controller_node.cpp.
bool MotorControllerNode::move_abs_pos | ( | motor_controller_msgs::MoveAbsPos::Request & | req, |
motor_controller_msgs::MoveAbsPos::Response & | resp | ||
) |
Callback to move motors by absolute position.
req | MoveAbsPos type request. |
resp | MoveAbsPos type response. |
Definition at line 320 of file motor_controller_node.cpp.
bool MotorControllerNode::move_rel_pos | ( | motor_controller_msgs::MoveAbsPos::Request & | req, |
motor_controller_msgs::MoveAbsPos::Response & | resp | ||
) |
Callback to move motors by relative position.
req | MoveAbsPos type request. |
resp | MoveAbsPos type response. |
Definition at line 335 of file motor_controller_node.cpp.
bool MotorControllerNode::move_vel | ( | motor_controller_msgs::MoveAbsPos::Request & | req, |
motor_controller_msgs::MoveAbsPos::Response & | resp | ||
) |
Callback to move motors in velocity.
req | MoveAbsPos type request. |
resp | MoveAbsPos type response. |
Definition at line 350 of file motor_controller_node.cpp.
void MotorControllerNode::publish | ( | ) |
Publish information from the motors.
Definition at line 168 of file motor_controller_node.cpp.
bool MotorControllerNode::set_cur_lim | ( | motor_controller_msgs::Configuration::Request & | req, |
motor_controller_msgs::Configuration::Response & | resp | ||
) |
Callback to set the current limit of the motor.
req | Configuration type request. |
resp | Configuration type response. |
Definition at line 293 of file motor_controller_node.cpp.
bool MotorControllerNode::set_max_acc | ( | motor_controller_msgs::Configuration::Request & | req, |
motor_controller_msgs::Configuration::Response & | resp | ||
) |
Callback to set the maximum acceleration of the motor.
req | Configuration type request. |
resp | Configuration type response. |
Definition at line 267 of file motor_controller_node.cpp.
bool MotorControllerNode::set_max_dec | ( | motor_controller_msgs::Configuration::Request & | req, |
motor_controller_msgs::Configuration::Response & | resp | ||
) |
Callback to set the maximum deceleration of the motor.
req | Configuration type request. |
resp | Configuration type response. |
Definition at line 280 of file motor_controller_node.cpp.
bool MotorControllerNode::set_max_pos | ( | motor_controller_msgs::Configuration::Request & | req, |
motor_controller_msgs::Configuration::Response & | resp | ||
) |
Callback to set the maximum position of the motor.
req | Configuration type request. |
resp | Configuration type response. |
Definition at line 227 of file motor_controller_node.cpp.
bool MotorControllerNode::set_max_vel | ( | motor_controller_msgs::Configuration::Request & | req, |
motor_controller_msgs::Configuration::Response & | resp | ||
) |
Callback to set the maximum velocity of the motor.
req | Configuration type request. |
resp | Configuration type response. |
Definition at line 254 of file motor_controller_node.cpp.
bool MotorControllerNode::set_min_pos | ( | motor_controller_msgs::Configuration::Request & | req, |
motor_controller_msgs::Configuration::Response & | resp | ||
) |
Callback to set the minimum position of the motor.
req | Configuration type request. |
resp | Configuration type response. |
Definition at line 241 of file motor_controller_node.cpp.
bool MotorControllerNode::set_odometry_calibration | ( | motor_controller_msgs::Configuration::Request & | req, |
motor_controller_msgs::Configuration::Response & | resp | ||
) |
Callback to set the odometry calibration of the motor.
req | Configuration type request. |
resp | Configuration type response. |
Definition at line 303 of file motor_controller_node.cpp.
void MotorControllerNode::spin | ( | ) |
Spin the node.
Definition at line 155 of file motor_controller_node.cpp.
Definition at line 182 of file motor_controller_node.h.
ros::Publisher MotorControllerNode::_data_msg [private] |
Definition at line 173 of file motor_controller_node.h.
MotorDriverInterface* MotorControllerNode::_driver [private] |
Definition at line 197 of file motor_controller_node.h.
int MotorControllerNode::_joint_id [private] |
Definition at line 192 of file motor_controller_node.h.
std::string MotorControllerNode::_joint_name [private] |
Definition at line 193 of file motor_controller_node.h.
Definition at line 180 of file motor_controller_node.h.
Definition at line 181 of file motor_controller_node.h.
Definition at line 177 of file motor_controller_node.h.
Definition at line 179 of file motor_controller_node.h.
Definition at line 178 of file motor_controller_node.h.
Definition at line 184 of file motor_controller_node.h.
Definition at line 185 of file motor_controller_node.h.
Definition at line 186 of file motor_controller_node.h.
ros::NodeHandle MotorControllerNode::_nh [private] |
Definition at line 169 of file motor_controller_node.h.
Definition at line 170 of file motor_controller_node.h.
ros::Publisher MotorControllerNode::_odo_msg [private] |
Definition at line 174 of file motor_controller_node.h.
Definition at line 183 of file motor_controller_node.h.
int MotorControllerNode::_pos_factor [private] |
Definition at line 195 of file motor_controller_node.h.
ros::Rate MotorControllerNode::_publish_rate [private] |
Definition at line 189 of file motor_controller_node.h.
std::string MotorControllerNode::_serial_device [private] |
Definition at line 193 of file motor_controller_node.h.
int MotorControllerNode::_vel_factor [private] |
Definition at line 195 of file motor_controller_node.h.