Main Page
Namespaces
Classes
Files
File List
File Members
include
noid_mover_controller.h
Go to the documentation of this file.
1
3
#ifndef NOID_MOVER_CONTROLLER_H_
4
#define NOID_MOVER_CONTROLLER_H_
5
6
#include <
ros/ros.h
>
7
#include <
ros/callback_queue.h
>
8
9
#include <geometry_msgs/PoseStamped.h>
10
#include <geometry_msgs/Twist.h>
11
#include <nav_msgs/Odometry.h>
12
#include <
tf/transform_broadcaster.h
>
13
14
#include "
noid_lower_controller.h
"
15
#include "
noid_robot_hardware.h
"
16
17
namespace
noid
18
{
19
namespace
mover
20
{
21
22
#define MAX_ACC_X 1.0
23
#define MAX_ACC_Y 1.0
24
#define MAX_ACC_Z 3.0
25
26
struct
pose
27
{
28
float
x
;
29
float
y
;
30
float
theta
;
31
};
32
33
class
NoidMoverController
34
{
35
public
:
36
explicit
NoidMoverController
(
const
ros::NodeHandle
& _nh,
noid_robot_hardware::NoidRobotHW
*_in_hw);
37
~
NoidMoverController
();
38
39
private
:
40
void
cmdVelCallback(
const
geometry_msgs::TwistConstPtr& _cmd_vel);
41
void
safetyCheckCallback(
const
ros::TimerEvent
& _event);
42
void
calculateOdometry(
const
ros::TimerEvent
& _event);
43
void
velocityToWheel(
double
_linear_x,
double
_linear_y,
double
_angular_z, std::vector<int16_t>& _wheel_vel);
44
45
ros::NodeHandle
nh_
;
46
ros::Publisher
odom_pub_
;
47
ros::Time
current_time_, last_time_,
time_stamp_
;
48
ros::Timer
odom_timer_,
safe_timer_
;
49
ros::Subscriber
cmd_vel_sub_
;
50
tf::TransformBroadcaster
odom_broadcaster_
;
51
52
/*
53
ros::SubscribeOptions base_ops_;
54
ros::CallbackQueue base_queue_;
55
ros::AsyncSpinner base_spinner_;
56
*/
57
58
double
vx_, vy_, vth_, x_,
y_
, th_;
59
double
ros_rate_, odom_rate_,
safety_rate_
, safety_duration_;
60
float
k1_,
k2_
;
61
int
num_of_wheels_
;
62
bool
servo_on_
;
63
std::vector<std::string>
wheel_names_
;
64
std::vector<int>
aero_index_
;
65
66
boost::mutex
base_mtx_
;
67
noid_robot_hardware::NoidRobotHW
*
hw_
;
68
69
};
70
71
//typedef std::shared_ptr<NoidMoverController> NoidMoverControllerPtr;
72
73
}
//mover
74
}
//noid
75
76
#endif
noid::mover::NoidMoverController::k2_
float k2_
Definition:
noid_mover_controller.h:60
noid
ros::NodeHandle
noid::mover::NoidMoverController::wheel_names_
std::vector< std::string > wheel_names_
Definition:
noid_mover_controller.h:63
ros::Time
noid::mover::NoidMoverController::base_mtx_
boost::mutex base_mtx_
Definition:
noid_mover_controller.h:66
noid::mover::pose::y
float y
Definition:
noid_mover_controller.h:29
noid::mover::NoidMoverController::odom_broadcaster_
tf::TransformBroadcaster odom_broadcaster_
Definition:
noid_mover_controller.h:50
noid_lower_controller.h
transform_broadcaster.h
noid::mover::NoidMoverController::odom_pub_
ros::Publisher odom_pub_
Definition:
noid_mover_controller.h:46
noid::mover::NoidMoverController::nh_
ros::NodeHandle nh_
Definition:
noid_mover_controller.h:45
noid::mover::pose::theta
float theta
Definition:
noid_mover_controller.h:30
ros::Subscriber
noid::mover::NoidMoverController::servo_on_
bool servo_on_
Definition:
noid_mover_controller.h:62
noid::mover::NoidMoverController
Definition:
noid_mover_controller.h:33
noid::mover::NoidMoverController::safe_timer_
ros::Timer safe_timer_
Definition:
noid_mover_controller.h:48
ros.h
noid::mover::pose
Definition:
noid_mover_controller.h:26
noid_robot_hardware::NoidRobotHW
Definition:
noid_robot_hardware.h:74
noid::mover::NoidMoverController::safety_rate_
double safety_rate_
Definition:
noid_mover_controller.h:59
noid::mover::NoidMoverController::aero_index_
std::vector< int > aero_index_
Definition:
noid_mover_controller.h:64
noid::mover::NoidMoverController::num_of_wheels_
int num_of_wheels_
Definition:
noid_mover_controller.h:61
ros::Publisher
noid::mover::NoidMoverController::hw_
noid_robot_hardware::NoidRobotHW * hw_
Definition:
noid_mover_controller.h:67
noid::mover::NoidMoverController::time_stamp_
ros::Time time_stamp_
Definition:
noid_mover_controller.h:47
noid::mover::NoidMoverController::y_
double y_
Definition:
noid_mover_controller.h:58
noid_robot_hardware.h
ros::Timer
callback_queue.h
tf::TransformBroadcaster
ros::TimerEvent
noid::mover::pose::x
float x
Definition:
noid_mover_controller.h:28
noid::mover::NoidMoverController::cmd_vel_sub_
ros::Subscriber cmd_vel_sub_
Definition:
noid_mover_controller.h:49
noid_ros_controller
Author(s): Yohei Kakiuchi
autogenerated on Sat Jul 20 2019 03:44:30