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

DanEB's profile - activity

2022-03-01 02:26:35 -0500 received badge  Notable Question (source)
2022-03-01 02:26:35 -0500 received badge  Popular Question (source)
2021-04-26 01:25:11 -0500 received badge  Famous Question (source)
2021-04-06 03:02:37 -0500 commented answer Stopping teleop without shutting down SMACH state-machine

I just realized that it was yocs_cmd_vel_mux that I have been looking at.

2021-04-03 14:05:02 -0500 commented answer Stopping teleop without shutting down SMACH state-machine

This fixes it! I am a bit puzzled right now, because I am sure I checked twist_mux a few days ago, and it was not suppor

2021-04-03 14:04:34 -0500 marked best answer Stopping teleop without shutting down SMACH state-machine

I'm building a mobile robot that is using SMACH for high-level task management. I'm starting of trying to give users the ability to chose between between exploration and teleoperation. I have no issues setting up the the state-machine, and and the transistions between states seems to work fine. Both teleop and exploration starts up after adding the user-input.

The issue I'm running into is when I want to stop the teleop_twist_keyboard-node, and transistion back to mode select state(teleop or exploration). The only way that seem to stop teleop is using CTRL-C, and that shuts down the whole program, including the state-machine. I thought about using threading, but teleop seems to allready be using it, so I'm not sure if that is the correct path to pursue.

Have anyone been able to find a way to stop the teleop_twist_keyboard-node and without shutting down the state-machine?

I will gladly post code, but I'm not sure what to post for this one.

UPDATE: I am now able to stop teleop without shutting down the state-machine with the help of subprocess.Popen. But now it won't let me control the robot from the terminal, and quits teleop preemptively. This the two main states I'm switching between:

class RoamMode(smach.State):
     def init(self):
          smach.State.init(self, outcomes= ['Exploraiton mode selected', 'Teleoperation mode selected', 'Wrong key'])

     def execute(self, userdata):
          user_input = input('Press T for Teleoperation mode, or press E for Exploration mode')

          if user_input == 'T':
              return 'Teleoperation mode selected'
           elif user_input =='E':
              return 'Exploraiton mode selected'
           else:
              return 'Wrong key'

class RoamTeleOp(smach.State):
    def init(self):
       smach.State.init(self, outcomes=['Teleoperation stopped'])

    def execute(self, userdata):
       tp_process = subprocess.Popen('python3 run_teleop.py', shell=True)
       if tp_process.poll() == None:
          tp_process.kill()
          rospy.sleep(10.)
          return 'Teleoperation stopped'

This is the other file I'm running with subprocess.Popen('python3 run_teleop.py', shell=True):

import rospy
import roslaunch

package = 'teleop_twist_keyboard'
executable = 'teleop_twist_keyboard.py'
node = roslaunch.core.Node(package, executable)
launch = roslaunch.scriptapi.ROSLaunch()
launch.start()
process = launch.launch(node)
rospy.spin()
2021-04-03 14:04:34 -0500 received badge  Scholar (source)
2021-04-03 14:04:13 -0500 commented answer Stopping teleop without shutting down SMACH state-machine

This fixes it! I am a bit puzzled right now, because I am sure checked twist_mux a few days ago, and it was not supporte

2021-04-03 01:24:44 -0500 received badge  Notable Question (source)
2021-04-02 06:40:33 -0500 received badge  Popular Question (source)
2021-03-30 13:05:55 -0500 commented question Stopping teleop without shutting down SMACH state-machine

The way that teleop is implemented it made sense to me to stop the node, rather than running it through a topic with wit

2021-03-30 13:02:56 -0500 commented question Stopping teleop without shutting down SMACH state-machine

The way that teleop is implemented it made sense to me to stop the node, rather than running it through a topic with wit

2021-03-30 13:02:24 -0500 commented question Stopping teleop without shutting down SMACH state-machine

The way that teleop is implemented it made sense to me to stop the node, rather than running through a topic with with s

2021-03-29 19:05:30 -0500 edited question Stopping teleop without shutting down SMACH state-machine

Stopping teleop without shutting down SMACH state-machine I'm building a mobile robot that is using SMACH for high-level

2021-03-29 18:29:37 -0500 commented question Stopping teleop without shutting down SMACH state-machine

You sugest using another thread to kill the node, while it's running? EDIT: Still have not figured out a practical way

2021-03-29 15:26:57 -0500 commented question Stopping teleop without shutting down SMACH state-machine

You sugest using another thread to kill the node, while it's running?

2021-03-29 14:09:45 -0500 asked a question Stopping teleop without shutting down SMACH state-machine

Stopping teleop without shutting down SMACH state-machine I'm building a mobile robot that is using SMACH for high-level

2021-03-29 14:09:44 -0500 asked a question Stopping teleop without shutting down SMACH state-machine

Stopping teleop without shutting down SMACH state-machine I'm building a mobile robot that is using SMACH for high-level

2021-03-20 03:22:49 -0500 received badge  Enthusiast
2021-03-19 04:17:57 -0500 received badge  Supporter (source)
2021-03-17 18:17:23 -0500 commented answer Omnidirectional Four_wheel_steering_controllers/base-controllers

I am looking for exactly this! But I'm having no luck trying to google "swervebot_controller". Can you please share the

2021-03-15 14:23:58 -0500 asked a question Not being able to find controllers in rostopic

Not being able to find controllers in rostopic Setup is Ubuntu 20.04, ROS Noetic. We are working with a costume robot,