ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

kdorsel's profile - activity

2019-08-07 14:40:51 -0500 received badge  Favorite Question (source)
2019-04-17 19:35:04 -0500 received badge  Nice Question (source)
2019-02-25 05:06:27 -0500 received badge  Famous Question (source)
2019-01-06 11:23:08 -0500 commented question stuck robot problem

@pavel92, were you able to fix this? I have the same issue with a robot being stuck and getting 0 0 0 cmd_vel.

2018-12-05 06:12:57 -0500 received badge  Notable Question (source)
2018-12-05 00:50:11 -0500 received badge  Student (source)
2018-12-05 00:50:04 -0500 received badge  Popular Question (source)
2018-11-16 21:15:18 -0500 edited question roslibjs auto disconnected when calling any function

roslibjs auto disconnected when calling any function I'm running melodic on macOS 10.13.6. I got the latest rosauth an

2018-11-16 21:13:23 -0500 edited question roslibjs auto disconnected when calling any function

roslibjs auto disconnected when calling anything function I'm running melodic on macOS 10.13.6. I got the latest rosau

2018-11-16 21:13:23 -0500 received badge  Editor (source)
2018-11-16 21:13:01 -0500 asked a question roslibjs auto disconnected when calling any function

roslibjs auto disconnected when calling anything function I'm running melodic on macOS 10.13.6. I got the latest rosau

2016-02-19 19:01:37 -0500 received badge  Famous Question (source)
2015-03-17 14:15:01 -0500 commented answer starting multiple instances of same callback in MultiThreadedSpinner

I think the AsyncSpinner will be the next thing I try and have the SM loop right have the spinner.

2015-03-17 14:14:26 -0500 commented question starting multiple instances of same callback in MultiThreadedSpinner

I've read through all the documentation i can find. This page from another document sums it up nicely. https://dl.dropboxusercontent.com/u/2... . There's no continuous motion for the RAPL-3 or ASH interface. I only have access to the jog type command

2015-03-17 13:11:42 -0500 commented question starting multiple instances of same callback in MultiThreadedSpinner

Using a crs a255 5 axis robot. It doesn't have a continuous mode, only incremental or final destination. To move it while the action is happening I need to continuously send small increments.

2015-03-17 10:25:06 -0500 received badge  Notable Question (source)
2015-03-17 09:44:37 -0500 commented question starting multiple instances of same callback in MultiThreadedSpinner

So essentially create a secondary thread that monitors some global variables and sends the necessary jog commands to the robot. And have the cb just update those variables.

2015-03-17 07:56:40 -0500 received badge  Supporter (source)
2015-03-17 07:56:22 -0500 commented question starting multiple instances of same callback in MultiThreadedSpinner

I understand that callbacks should not be blocked, but I really can't see any other way to do this. I've update the question with more information.

2015-03-17 07:39:38 -0500 received badge  Popular Question (source)
2015-03-16 23:47:18 -0500 asked a question starting multiple instances of same callback in MultiThreadedSpinner

My end goal is to have a callback receive a message and until the next message is received to run a few lines of code in an infinite loop.

My initial thought was to create a MultiThreadedSpinner and implement the callback like so. Where stop is a global variable.

void callback(const std_msgs::UInt8::ConstPtr &msg) {
  if (msg->data == 1) {
    stop = true;
    return;   
  }
  // else start the loop
  stop = false;
  while (!stop) {
    //simple serial connection code
    // sleep 500ms
  }
}

When the messages is received it would create a blacking callback. Then when a new message is received it would set the stop variable and the first started callback would then end. But from what I seem to have figured out the MultiThreadedSpinner will not call the same callback again while one is already running.

Hopefully that makes some sense. Any thoughts on how to do this?

EDIT - Bigger Picture My input device sends int as messages. Let's say it can be 0, 1 or 2. Where 0 is no action, 1 is action 1 and 2 is action 2. The way the device works is that it only sends a message on action change. Read differently, there are no messages when an action is held.

After action 1 or 2 you are guaranteed to receive action 0 first before anything else.

My output device needs to incrementally move a small delta (forward for 1 and reverse for 2) while an action is being performed and stop moving when the action stops being performed. Essentially I have to manually jog the robot by small increments when the first message is sent until the next message is sent.