fake_kobuki.cpp
Go to the documentation of this file.
2 
3 namespace kobuki
4 {
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 }
void init(ros::NodeHandle &nh)
Definition: fake_kobuki.cpp:5
double cmd_vel_timeout
Definition: fake_kobuki.h:83
sensor_msgs::JointState joint_states
Definition: fake_kobuki.h:71
nav_msgs::Odometry odom
Definition: fake_kobuki.h:72
std::string wheel_joint_name[2]
Definition: fake_kobuki.h:77
bool param(const std::string &param_name, T &param_val, const T &default_val) const
float odom_pose[3]
Definition: fake_kobuki.h:73
kobuki_msgs::VersionInfo versioninfo
Definition: fake_kobuki.h:69
float wheel_speed_cmd[2]
Definition: fake_kobuki.h:78


kobuki_softnode
Author(s): Jihoon Lee
autogenerated on Mon Jun 10 2019 13:52:14