Comments (3)
Thank you for using the dynamixel_control. I haven't used it with wheeled robot but I hope you can do it without any modification. Please show me the log.
from dynamixel_hardware.
I was able to troubleshoot the issue and it actually works with some minor changes:
- Main issue was ros2_control diff_drive_controller continuously sends linear and angular velocities of 0 when the cmd_vel timeout is detected when you let go of joystick. So when you are moving the robot around, it works fine but it never stops the robot due to the if statement in line 286, of write method, which only goes into that logic if velocity != 0. So I had to comment that if statement so the robot will stop when 0 velocities are sent by the diff_drive_controller.
// commented if statement to allow robot to receive 0 velocity from diff_drive_controller
286 //if (std::any_of(
// joints_.cbegin(), joints_.cend(), [](auto j) { return j.command.velocity != 0.0; })) {
// Velocity control
// line below is also not necessary to call every time if the robot is only used in velocity control mode and it is set during configure method
set_control_mode(ControlMode::Velocity);
for (uint i = 0; i < ids.size(); i++) {
commands[i] = dynamixel_workbench_.convertVelocity2Value(
ids[i], static_cast<float>(joints_[i].command.velocity));
}
if (!dynamixel_workbench_.syncWrite(
kGoalVelocityIndex, ids.data(), ids.size(), commands.data(), 1, &log)) {
RCLCPP_ERROR(rclcpp::get_logger(kDynamixelHardware), "%s", log);
}
return return_type::OK;
// }
- Optional change 1 - since I'm using the robot in wheel mode/velocity mode, I commented out position control code in write method as it is not being used. This change is not required for the fix.
- Optional change 2 - in header file I set the default control mode to velocity mode instead of position control. This change is also not required for the fix.
ControlMode control_mode_{ControlMode::Velocity};
Alternatively, you can set the default mode velocity control in line 93 of on_init method:
enable_torque(false);
93 set_control_mode(ControlMode::Velocity, true);
enable_torque(true);
I also ran into issues related to dynamixel speed not working correctly but those issues were fixed by tuning the diff_drive_controller config file parameters and had nothing to do with hardware interface code.
Thanks again for such a quick response and hope this helps someone else.
from dynamixel_hardware.
Nice report. Thank you!
from dynamixel_hardware.
Related Issues (20)
- Transfer repository from youtalk to dynamixel-community HOT 2
- No gripper movement HOT 4
- Torque control and motor rebooting HOT 1
- Problem with reaching the set position precisely
- Set Dynamixel PID gain parameters for position and velocity HOT 2
- failed to run gazebo launch file HOT 1
- Fix CI HOT 1
- Unable to control open manipulator-x hardware with rviz
- false gripper joint value
- Change in velocity control mode HOT 1
- Add virtual joint
- SimpleTransmission and dynamixel_hardware
- Using both position and velocity controller HOT 2
- Velocity control mode doesn't work in dummy mode
- Releases for iron, jazzy and rolling HOT 4
- Change name of port to "port_name"
- `[TxRxResult] Port is in use!` error working with XC330-M288T on ROS2 Humble HOT 1
- Running ROS2 Controller Manager at high loop rate - groupSyncRead error HOT 2
- Understanding why you copy the joint_ids HOT 1
- Unwanted behaviour when reading fails but writing succeeds
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynamixel_hardware.