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

i/o yaml file #1

Open
OsmanElhassan opened this issue Apr 5, 2023 · 10 comments
Open

i/o yaml file #1

OsmanElhassan opened this issue Apr 5, 2023 · 10 comments

Comments

@OsmanElhassan
Copy link

OsmanElhassan commented Apr 5, 2023

i have 6 degree of freedom robotic arm and i want to connect its moveit2 package to my arduino mega, how would i write .yaml file to map the joints to desired i/o pins?
also i'm using stepper motors plus one servo motors for the gripper, can i use this package for the servo ros2_control hardware interface.

@openvmp
Copy link
Owner

openvmp commented Apr 6, 2023

I updated the documentation to provide answers to some of the questions.

The actuator package that you mentioned is like an abstract class. It's useless by itself, but it is used by remote_hardware_interface to drive packages that provide a compliant interface (for example PWM channels configured as actuator_velocity or actuator_position in this microcontroller package).
To be honest, I did not yet test the ros2_control part outside of the main OpenVMP setup where there is a couple of extra other building blocks that are responsible for wiring all modules with each other in a very OpenVMP specific way (naming convention).
So watch out for the naming of topics and services. In case it hangs, use ros2 node info to ensure that the consumers and producers use the same names.

While the original use case for this library is a robot with 12 steppers, 12 servo and 4 BLDCs, it currently only works for PWM servos and UART (ModBus/RS485) steppers.
I plan to add support for PUL/DIR steppers on this weekend. Stay tuned.

Overall, be mindful that the first line of code for this module was written like 10 days ago.
So adjust your expectations for both the reliability of the current state and what's it's going to be like in 10 days from now.

@OsmanElhassan
Copy link
Author

thank you i appreciate your response.
i tried to build the package but i get this error:

Starting >>> remote_actuator
Starting >>> remote_switch
Starting >>> ros2_serial
--- stderr: remote_switch                                                                                               
CMake Error at CMakeLists.txt:24 (rosidl_get_typesupport_target):
  Unknown CMake command "rosidl_get_typesupport_target".


---
Failed   <<< remote_switch [4.87s, exited with code 1]
Aborted  <<< ros2_serial [5.08s]                                                                      
Aborted  <<< remote_actuator [5.24s]                           

Summary: 0 packages finished [5.67s]
  1 package failed: remote_switch
  2 packages aborted: remote_actuator ros2_serial
  3 packages had stderr output: remote_actuator remote_switch ros2_serial
  2 packages not processed

it seems like because i'm running ros2 foxy while "rosidl_get_typesupport_target" is compatible with humble and higher. is there any way to make it work for foxy

@openvmp
Copy link
Owner

openvmp commented Apr 7, 2023

There is plenty of examples how to convert from Foxy syntax to the Humble one.
E.g. ros2/demos@a8f78d7
You can just do the reverse changes and see if it helps.
Share the pull request if it compiles, I'll create a branch for foxy.

I've spent a couple hours trying to get Foxy up and running on my MacBook, but it just doesn't work.
RoboStack gave up on supporting it: https://github.com/RoboStack/ros-foxy
Foxy is officially end of life next month.
Are you sure Humble is not an option?

@openvmp
Copy link
Owner

openvmp commented Apr 8, 2023

I just added the branch "foxy" to all of the modules.
It compiles fine but I didn't test it with the real hardware yet.
Please, let me know if it works for you at least to send come PWM commands.

@openvmp
Copy link
Owner

openvmp commented Apr 8, 2023

Though the same code works for Humble as well, so you can just pull the latest changes on the main branch.

@OsmanElhassan
Copy link
Author

i just compiled it on my host machine but haven't test it on my hardware yet. i will keep you updated.
also i think my stepper can not use this package stepper_driver_em2rs, so looking forward for PUL/DIR steppers support update

@openvmp
Copy link
Owner

openvmp commented Apr 10, 2023

Almost there. Stay tuned.

@openvmp
Copy link
Owner

openvmp commented Apr 12, 2023

Give it a try, please

@OsmanElhassan
Copy link
Author

OsmanElhassan commented Apr 12, 2023

thanks a lot, will definitely give it a try.
btw I'm curious if i can use joint_trajectory_controller with the stepper interface, given that it requires at least position command(if i understand it correct).
or do i need to use other controller?

@openvmp
Copy link
Owner

openvmp commented Apr 13, 2023

Sure, that is possible. The only question is the precision. That's what OpenVMP robot does in the "use_fake_hardware" mode. That's also what I do in the real robot for the joints where I didn't install the encoders yet.

But it works with a trick. I use the node "fake" from "remote_encoder". It listens for the state changes in the "remote_actuator" and attempts to approximate what the position is, assuming the actuator is successful at what it's attempting to perform. Just make sure to have an update rate high enough to reduce approximation errors.

In theory, the mode "remote_stepper_driver" must be improved to implement "remote_encoder" out of the box for open loop control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants