Main Page
Namespaces
Classes
Files
File List
File Members
src
library
fake_kobuki.cpp
Go to the documentation of this file.
1
#include <
kobuki_softnode/fake_kobuki.h
>
2
3
namespace
kobuki
4
{
5
void
FakeKobuki::init
(
ros::NodeHandle
& nh)
6
{
7
this->
wheel_speed_cmd
[
LEFT
] = 0.0;
8
this->
wheel_speed_cmd
[
RIGHT
] = 0.0;
9
10
// using the same values as in kobuki_node
11
double
pcov[36] = { 0.1, 0, 0, 0, 0, 0,
12
0, 0.1, 0, 0, 0, 0,
13
0, 0, 1e6, 0, 0, 0,
14
0, 0, 0, 1e6, 0, 0,
15
0, 0, 0, 0, 1e6, 0,
16
0, 0, 0, 0, 0, 0.2};
17
memcpy(&(this->
odom
.pose.covariance),pcov,
sizeof
(
double
)*36);
18
memcpy(&(this->
odom
.twist.covariance),pcov,
sizeof
(
double
)*36);
19
20
// wheel information from kobuki_gazebo
21
this->
wheel_separation
= 0.23;
22
this->
wheel_diameter
= 0.070;
23
24
// joint states
25
nh.
param
(
"wheel_left_joint_name"
,this->
wheel_joint_name
[
LEFT
], std::string(
"wheel_left_joint"
));
26
nh.
param
(
"wheel_right_joint_name"
,this->
wheel_joint_name
[
RIGHT
], std::string(
"wheel_right_joint"
));
27
nh.
param
(
"cmd_vel_timeout"
,this->
cmd_vel_timeout
, 0.6);
28
this->
cmd_vel_timeout
= 1.0;
29
30
this->
motor_enabled
=
true
;
31
32
this->
joint_states
.header.frame_id =
"Joint States"
;
33
this->
joint_states
.name.push_back(
wheel_joint_name
[LEFT]);
34
this->
joint_states
.name.push_back(
wheel_joint_name
[RIGHT]);
35
this->
joint_states
.position.resize(2,0.0);
36
this->
joint_states
.velocity.resize(2,0.0);
37
this->
joint_states
.effort.resize(2,0.0);
38
39
// odometry
40
nh.
param
(
"odom_frame"
,this->
odom
.header.frame_id,std::string(
"odom"
));
41
nh.
param
(
"base_frame"
,this->
odom
.child_frame_id,std::string(
"base_footprint"
));
42
43
this->
versioninfo
.hardware =
"dumb"
;
44
this->
versioninfo
.firmware =
"fake"
;
45
this->
versioninfo
.software =
"0.0.0"
;
46
47
this->
odom_pose
[0] = 0;
48
this->
odom_pose
[1] = 0;
49
this->
odom_pose
[2] = 0;
50
51
}
52
}
kobuki::FakeKobuki::motor_enabled
bool motor_enabled
Definition:
fake_kobuki.h:82
kobuki::FakeKobuki::init
void init(ros::NodeHandle &nh)
Definition:
fake_kobuki.cpp:5
ros::NodeHandle
kobuki::FakeKobuki::cmd_vel_timeout
double cmd_vel_timeout
Definition:
fake_kobuki.h:83
fake_kobuki.h
kobuki::FakeKobuki::wheel_separation
float wheel_separation
Definition:
fake_kobuki.h:79
kobuki::FakeKobuki::joint_states
sensor_msgs::JointState joint_states
Definition:
fake_kobuki.h:71
kobuki::FakeKobuki::odom
nav_msgs::Odometry odom
Definition:
fake_kobuki.h:72
kobuki::FakeKobuki::wheel_joint_name
std::string wheel_joint_name[2]
Definition:
fake_kobuki.h:77
kobuki::LEFT
Definition:
fake_kobuki.h:59
kobuki
Definition:
fake_kobuki.h:56
ros::NodeHandle::param
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
kobuki::FakeKobuki::odom_pose
float odom_pose[3]
Definition:
fake_kobuki.h:73
kobuki::FakeKobuki::versioninfo
kobuki_msgs::VersionInfo versioninfo
Definition:
fake_kobuki.h:69
kobuki::FakeKobuki::wheel_speed_cmd
float wheel_speed_cmd[2]
Definition:
fake_kobuki.h:78
kobuki::RIGHT
Definition:
fake_kobuki.h:60
kobuki::FakeKobuki::wheel_diameter
float wheel_diameter
Definition:
fake_kobuki.h:80
kobuki_softnode
Author(s): Jihoon Lee
autogenerated on Mon Jun 10 2019 13:52:14