ICube-Robotics / ethercat_driver_ros2

Hardware Interface for EtherCAT module integration with ros2_control
https://icube-robotics.github.io/ethercat_driver_ros2/
Apache License 2.0
126 stars 32 forks source link

control the position of a motor #50

Closed Brethiltaras closed 1 year ago

Brethiltaras commented 1 year ago

Bonjour! I want to use the joint trajectory controller to control the position of my servo motor.

Below is my ROS2 control description:

`<?xml version="1.0"?>

ethercat_driver/EthercatDriver 0 10 ethercat_plugins/Maxon_EPOS3 0 0 8

`

The motor doesn't follow the controller's command. Joint state broadcaster is working correctly. I'm not sure whether the ROS2 control description is correct. Can anyone help?

Merci Beaucoup!!!!

mcbed commented 1 year ago

Hi, on first glance it looks fine event if the control frequency is rather low. Did you check if the position control loop of your drive is set up correctly and that the drive is not in fault ?

Brethiltaras commented 1 year ago

I found the problem. It might be because I'm not using a maxon drive. I will try to adapt the driver source code to make it work with my drive. Thanks for your time!

wei1224hf commented 2 months ago

how to send the position command ? by console command or , have to write some complex code?

yguel commented 2 months ago

Dear wei1224hf, Actually you may use several ways to send position command, using console or using a node that publish on a topic. Basically, you have to

  1. choose a position controller (or write one)
  2. find out which topic it uses to receive command
  3. you have then 2 options :
    1. send commands to that topic from command line (mainly for prototyping)
    2. use a dedicated program to publish to the topic (like one that interfaces with a joystick, keyboard, etc.)

As it is a ROS/ros control related question, I refer you to the documentation concerning those projects. You can have a look to one of the following tutorials for instance:

2 last things:

  1. if you post your question to one of the forum dedicated with ros2, you should indicate the controller you will use.
  2. this very issue, you posted in, was closed and your question was not really related to it, so in the future you should post your question in a new issue and if you think it is related to an other provides a link to it.

Happy coding !