botamochi6277 / ros2_pigpio

ROS2 package to control raspberry pi GPIO with pigpio
MIT License
19 stars 5 forks source link

Pigpio serial data writer #2

Open Russ76 opened 10 months ago

Russ76 commented 10 months ago

This is almost just what I am looking for. However, the data I want my Ros2_controller to send the Raspi is a data integer to a serial com pin. This is to drive the Sabertooth motor controller, a powerful and reliable controller.

I almost have it working but Ros2_control doesn't like working with the Pigpio library. Have you done such a thing before with the Pigpio library?

Thanks, Russ

Russ76 commented 10 months ago

I'm using Raspi 4 with 2 gig memory and Ubuntu 22.04 server and Ros2 Humble.

botamochi6277 commented 10 months ago

Thank you for using my repository. Unfortunately, I have not use any Sabertooth motor controlling modules. I estimate that your system is like the following diagram

graph LR

subgraph raspi

subgraph ros2
  ros2_controller-->|topic|ros2_pigpio
end
ros2_pigpio-->|request|pigpiod
end

pigpiod-->|signal|sabertooth[sabertooth module]
sabertooth-->|signal|motor

Your problem probably has relationship between ros_communication, pigpio_communitation, electric_signal for the sabertooth module, and electric circuit.

Sorry, I cannot identify the causes of your problem. I recommend you check each factor step by step. For example, driving motor without this repository and ROS2 but using pure pigpio.

Russ76 commented 10 months ago

Thanks for the quick answer. Ros2 control is faster than topics, almost real-time. I will continue to work with it, and may get it mastered. Ros2 control allows more close integration with robot commands and movement. My Raspi Python modules were adequate for mapping (manual robot control) but not for the robot driving itself. Its movement was erratic.