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

resolved merge conflicts #47

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ The message type can be changed to `geometry_msgs/msg/TwistStamped` by the `publ
- `scale_angular_turbo.yaw (double, default: 1.0)`
- `scale_angular_turbo.pitch (double, default: 0.0)`
- `scale_angular_turbo.roll (double, default: 0.0)`


<<<<<<< HEAD

=======
- `inverted_reverse (bool, default: false)`
- Whether to invert turning left-right while reversing (useful for differential wheeled robots).

Expand All @@ -77,7 +73,6 @@ The message type can be changed to `geometry_msgs/msg/TwistStamped` by the `publ

- `frame (string, default: 'teleop_twist_joy')`
- Frame name used for the header of TwistStamped messages.
>>>>>>> 76cd650 (Add an option to publish TwistStamped (#42))


# Usage
Expand Down
18 changes: 1 addition & 17 deletions src/teleop_twist_joy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,10 @@ namespace teleop_twist_joy
struct TeleopTwistJoy::Impl
{
void joyCallback(const sensor_msgs::msg::Joy::SharedPtr joy);
<<<<<<< HEAD
void sendCmdVelMsg(const sensor_msgs::msg::Joy::SharedPtr, const std::string& which_map);
=======
void sendCmdVelMsg(const sensor_msgs::msg::Joy::SharedPtr, const std::string & which_map);
void fillCmdVelMsg(
const sensor_msgs::msg::Joy::SharedPtr, const std::string & which_map,
geometry_msgs::msg::Twist * cmd_vel_msg);
>>>>>>> 76cd650 (Add an option to publish TwistStamped (#42))

rclcpp::Subscription<sensor_msgs::msg::Joy>::SharedPtr joy_sub;
rclcpp::Publisher<geometry_msgs::msg::Twist>::SharedPtr cmd_vel_pub;
Expand Down Expand Up @@ -88,10 +84,6 @@ TeleopTwistJoy::TeleopTwistJoy(const rclcpp::NodeOptions& options) : Node("teleo
{
pimpl_ = new Impl;

<<<<<<< HEAD
pimpl_->cmd_vel_pub = this->create_publisher<geometry_msgs::msg::Twist>("cmd_vel", 10);
pimpl_->joy_sub = this->create_subscription<sensor_msgs::msg::Joy>("joy", rclcpp::QoS(10),
=======
pimpl_->clock = this->get_clock();

pimpl_->publish_stamped_twist = this->declare_parameter("publish_stamped_twist", false);
Expand All @@ -105,7 +97,6 @@ TeleopTwistJoy::TeleopTwistJoy(const rclcpp::NodeOptions& options) : Node("teleo
}
pimpl_->joy_sub = this->create_subscription<sensor_msgs::msg::Joy>(
"joy", rclcpp::QoS(10),
>>>>>>> 76cd650 (Add an option to publish TwistStamped (#42))
std::bind(&TeleopTwistJoy::Impl::joyCallback, this->pimpl_, std::placeholders::_1));

pimpl_->require_enable_button = this->declare_parameter("require_enable_button", true);
Expand Down Expand Up @@ -366,19 +357,12 @@ void TeleopTwistJoy::Impl::sendCmdVelMsg(const sensor_msgs::msg::Joy::SharedPtr
sent_disable_msg = false;
}

<<<<<<< HEAD
cmd_vel_msg->linear.x = getVal(joy_msg, axis_linear_map, scale_linear_map[which_map], "x");
=======
void TeleopTwistJoy::Impl::fillCmdVelMsg(
const sensor_msgs::msg::Joy::SharedPtr joy_msg,
const std::string & which_map,
geometry_msgs::msg::Twist * cmd_vel_msg)
{
double lin_x = getVal(joy_msg, axis_linear_map, scale_linear_map[which_map], "x");
double ang_z = getVal(joy_msg, axis_angular_map, scale_angular_map[which_map], "yaw");

cmd_vel_msg->linear.x = lin_x;
>>>>>>> 76cd650 (Add an option to publish TwistStamped (#42))
cmd_vel_msg->linear.x = getVal(joy_msg, axis_linear_map, scale_linear_map[which_map], "x");
cmd_vel_msg->linear.y = getVal(joy_msg, axis_linear_map, scale_linear_map[which_map], "y");
cmd_vel_msg->linear.z = getVal(joy_msg, axis_linear_map, scale_linear_map[which_map], "z");
cmd_vel_msg->angular.z = getVal(joy_msg, axis_angular_map, scale_angular_map[which_map], "yaw");
Expand Down