mirror of
https://github.com/modelec/modelec-marcel-ROS.git
synced 2026-01-18 16:47:43 +01:00
joy value
This commit is contained in:
@@ -74,16 +74,16 @@ namespace Modelec
|
||||
[this](const sensor_msgs::msg::Joy::SharedPtr msg)
|
||||
{
|
||||
double left_axis = msg->axes[1];
|
||||
double right_axis = msg->axes[3];
|
||||
double right_axis = msg->axes[2];
|
||||
|
||||
if (fabs(left_axis) < 0.05) left_axis = 0.0;
|
||||
if (fabs(right_axis) < 0.05) right_axis = 0.0;
|
||||
|
||||
// int left = static_cast<int>(forward * 626 - turn * 626);
|
||||
// int right = static_cast<int>(forward * 626 + turn * 626);
|
||||
int left_motor = static_cast<int>(forward * 626 - turn * 626);
|
||||
int right_motor = static_cast<int>(forward * 626 + turn * 626);
|
||||
|
||||
int left_motor = static_cast<int>(left_axis * 626);
|
||||
int right_motor = static_cast<int>(right_axis * 626);
|
||||
// int left_motor = static_cast<int>(left_axis * 626);
|
||||
// int right_motor = static_cast<int>(right_axis * 626);
|
||||
|
||||
left_motor = std::max(-626, std::min(626, left_motor));
|
||||
right_motor = std::max(-626, std::min(626, right_motor));
|
||||
|
||||
Reference in New Issue
Block a user