How to send trajectory points and create a buffer #569
-
Disclaimer: I'm not using ROS for reasons I won't go into here. That being said, I've created my own streamer that sends simple_msg format over TCP, the same as would be found within ROS. I am sending the simple_msg of a trajectory point, and I am waiting until I receive a What I am finding is that the motoplus side is interpolating and filling up the inc queue and is essentially blocking until it finishes processing. This is found here. This will not release until either it fails to add the pulse increment OR finishes such that This, to me, makes it seem like I cannot send another point until I have received back that the previous point has been reached. To me, it seems like I already should have the next point in a buffer somewhere, so that once the first point is reached, it's not waiting for the next point to come in to continue the motion. Is my interpretation wrong? In practice, I'm doing a simple trajectory moving one joint 1 degree every 2 seconds (with the appropriate velocity at the intermediate points) for 10 points. I get the overall shape of the motion (it indeed goes through 10 degrees of motion) but it takes longer than the 20 seconds I would expect, and it looks like it still stops in between each waypoint. I'm trying to get behavior more like RSI, where I send a point every 4ms, but not finding success. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @emielkemmm When a subsequent point is received, the code will return BUSY until all of the increments from the first point have been populated into the queue. Once the first point has been increment-ized, then the code will accept another incoming point and start breaking it into increments. So as long as your second point comes in before the queue is empty, then you should get smooth continuous motion. Since there are 200 four-millisecond increments in the queue, you've got a window of 800 ms to submit the followup point before the queue is empty. |
Beta Was this translation helpful? Give feedback.
-
@emielkemmm: we're interested in adding more low-latency interfaces to MotoROS2 (so the ROS 2 interface). I'm planning on starting up a discussion with some other users that have either done similar things in the past with MotoROS1, or have expressed interest in such interfaces. Note that we won't be able to make anything faster than the controller supports (see #219 fi), but at least we can try to add as little additional latency with the interfaces we can make available. Would you be interested to join that discussion? |
Beta Was this translation helpful? Give feedback.
Hi @emielkemmm
When a point is received, it is broken down into 4ms increments. These increments get stored in an internal queue. That queue holds up to 200 increments.
When a subsequent point is received, the code will return BUSY until all of the increments from the first point have been populated into the queue. Once the first point has been increment-ized, then the code will accept another incoming point and start breaking it into increments.
So as long as your second point comes in before the queue is empty, then you should get smooth continuous motion. Since there are 200 four-millisecond increments in the queue, you've got a window of 800 ms to submit the followup point before the …