Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tf_prefix parameter for hardware interface #14

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions husky_base/include/husky_base/husky_hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ class HuskyHardware :

double polling_timeout_;

std::string tf_prefix_;

/**
* Joint structure that is hooked to ros_control's InterfaceManager, to allow control via diff_drive_controller
*/
Expand Down
5 changes: 3 additions & 2 deletions husky_base/src/husky_hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ namespace husky_base
private_nh_.param<double>("max_accel", max_accel_, 5.0);
private_nh_.param<double>("max_speed", max_speed_, 1.0);
private_nh_.param<double>("polling_timeout_", polling_timeout_, 10.0);
private_nh_.param<std::string>("tf_prefix", tf_prefix_, "");

std::string port;
private_nh_.param<std::string>("port", port, "/dev/prolific");
Expand Down Expand Up @@ -113,8 +114,8 @@ namespace husky_base
*/
void HuskyHardware::registerControlInterfaces()
{
ros::V_string joint_names = boost::assign::list_of("front_left_wheel")
("front_right_wheel")("rear_left_wheel")("rear_right_wheel");
ros::V_string joint_names = boost::assign::list_of(tf_prefix_ + "front_left_wheel")
(tf_prefix_ + "front_right_wheel")(tf_prefix_ + "rear_left_wheel")(tf_prefix_ + "rear_right_wheel");
for (unsigned int i = 0; i < joint_names.size(); i++)
{
hardware_interface::JointStateHandle joint_state_handle(joint_names[i],
Expand Down