Skip to content

Commit

Permalink
resolved merge conflicts (#47)
Browse files Browse the repository at this point in the history
Co-authored-by: Yannic Bachmann <[email protected]>
  • Loading branch information
YBachmann and Yannic Bachmann authored Jun 12, 2024
1 parent 324ceb7 commit 3cc3423
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
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

0 comments on commit 3cc3423

Please sign in to comment.