HumanoidPequi / HumanoidPMec_LARC2023

1 stars 1 forks source link

2 Dynamixel strugling to execute different angles #10

Closed lucasolives closed 1 year ago

lucasolives commented 1 year ago

Executing the codigo_baixo_nivel.ino in order to send different angles to each dynamixel, the servo was receiving those angles and executed in the first time that i published some data. In the following publications, the dynamixels stopped to answer the command correctly and made only little movements every time i sent a new angle.

lucasolives commented 1 year ago

Solution: I putted a delay of between each angle publication. That indicates that maybe the problem was the dynamixel not getting time to process two different data at the same time. At the moment, the delay is equals to 0,1milisecond, but i tested from 1 second until 0,001 milissecond and it worked fine.

lucasolives commented 1 year ago

Next questions: 1 - That delay will get us in trouble when the high level is executing by the fact that it stops the program during the time set? Even though it's a small delay? 2 - Apparently there's a function in ros that works kinda like a timer. I didn't go deeper in the subject, but the benefit would be that this function wouldn't stop the entire code, except that process. Using that, it would be possible to run another things on the code while the timer is waiting. Is it a better option? (Do some research about ros::Timer, ros::Duration and the function now())

lucasolives commented 1 year ago

Structure of ros command to send a UInt16MultiArray type of message(in our case where the topic is servo and we're sending two angles): rostopic pub servo std_msgs/UInt16MultiArray "data: [angle1, angle2]", where angle1 and angle2 unit is degree.