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

use only Twist not TwistStamped #11

Merged
merged 1 commit into from
Jul 24, 2023
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Controller Manager (`ros2_control`) will try to activate both on request, but th
ros2 control switch_controllers --activate streaming_controller --deactivate joint_trajectory_controller
```

By publishing `geometry_msgs::msg::TwistStamped` to `/streaming_controller/commands`, the commands will be piped to the driver
By publishing `geometry_msgs::msg::Twist` to `/streaming_controller/commands`, the commands will be piped to the driver
and streamed to the robot controller.

## PicknikResetFaultController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
#include <vector>

#include "controller_interface/controller_interface.hpp"
#include "geometry_msgs/msg/twist_stamped.hpp"
#include "geometry_msgs/msg/twist.hpp"
#include "picknik_twist_controller/visibility_control.h"
#include "realtime_tools/realtime_buffer.h"

namespace picknik_twist_controller
{
using CmdType = geometry_msgs::msg::TwistStamped;
using CmdType = geometry_msgs::msg::Twist;
using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn;

class PicknikTwistController : public controller_interface::ControllerInterface
Expand Down
12 changes: 6 additions & 6 deletions picknik_twist_controller/src/picknik_twist_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ controller_interface::return_type PicknikTwistController::update(
command_interfaces_.size());
return controller_interface::return_type::ERROR;
}
command_interfaces_[0].set_value((*twist_commands)->twist.linear.x);
command_interfaces_[1].set_value((*twist_commands)->twist.linear.y);
command_interfaces_[2].set_value((*twist_commands)->twist.linear.z);
command_interfaces_[3].set_value((*twist_commands)->twist.angular.x);
command_interfaces_[4].set_value((*twist_commands)->twist.angular.y);
command_interfaces_[5].set_value((*twist_commands)->twist.angular.z);
command_interfaces_[0].set_value((*twist_commands)->linear.x);
command_interfaces_[1].set_value((*twist_commands)->linear.y);
command_interfaces_[2].set_value((*twist_commands)->linear.z);
command_interfaces_[3].set_value((*twist_commands)->angular.x);
command_interfaces_[4].set_value((*twist_commands)->angular.y);
command_interfaces_[5].set_value((*twist_commands)->angular.z);

return controller_interface::return_type::OK;
}
Expand Down
Loading