Ask Your Question
0

How to structure project - Cmd vel Mux vs State machine?

asked 2020-06-08 04:38:24 -0500

jorgemia gravatar image

I'm making an autonomous mobile robot which will have various features which can be activated with different buttons. For example, one button should trigger wall following whilst another button will trigger person following.

What is the standard approach used in ROS to achieve something like this? Should I use a cmd vel mux node which receives messages from a wall following node and person following node and outputs commands according to the button pressed? Or should I use a state machine which tells the robot when this button is pressed go into the "wall following" state?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-10-02 10:16:45 -0500

jorgemia gravatar image

Like I said in my comment, I ended up creating a node that is basically a combination of a mux and state machine...It subscribes to different cmd_vel topics and a button input topic. Based on the button pressed it will switch state and republish the appropriate message to my diff drive controller cmd_vel topic.

Don't know if this is the best approach and maybe could look at the ROS SMACH package but this worked for now!

edit flag offensive delete link more
0

answered 2020-10-02 08:40:51 -0500

yelkcub gravatar image

I have nodes that implement different driving modes (ackerman/crab).

These control nodes are enabled and disabled from states within the smach state machine.

Seems like a reasonable implementation to me.

edit flag offensive delete link more

Comments

Yes, sounds reasonable. I ended up creating a node that is basically a combination of a mux and state machine...It subscribes to different cmd_vel topics and based on the button pressed it will switch state and republish the appropriate topic.

jorgemia gravatar image jorgemia  ( 2020-10-02 10:12:53 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-06-08 04:38:24 -0500

Seen: 99 times

Last updated: Oct 02 '20