[Discourse.ros.org] [ROS Projects] State Machine Visualization

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [ROS Projects] State Machine Visualization

derlcn via ros-users



This looks absolutely amazing @spmaniato!

Good luck @mcamp for your project!






---
[Visit Topic](https://discourse.ros.org/t/state-machine-visualization/1691/3) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [ROS Projects] State Machine Visualization

derlcn via ros-users




> Do you have any experience using state machines to write programs?

I used state machines at my first job doing industrial automation. We used [PLC programming](https://en.wikipedia.org/wiki/Programmable_logic_controller) and [PackML](https://en.wikipedia.org/wiki/PackML) structure for our state mahine. It was easy to setup and understand.

Now I'm a mobile robotisist and I am finding SMACH hard to setup and hard to understard :confused: so its good to hear someone is trying to improve it.

>How do you use the standard visualization of a state machine API when there is a visualization?

After starting my code I run rosrun smach_viewer smach_viewer.py as quick as possible to view my first few transitions. Then I got to the state I'm testing out, something doesn't work so I shut down my code and the SMACH viewer (it would be really nice if I could leave the SMACH viewer open and have it reconnect).

>Any experience of debugging a program using state machines?

I control my state transitions with an xbox controller which I find convenient.






---
[Visit Topic](https://discourse.ros.org/t/state-machine-visualization/1691/4) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [ROS Projects] State Machine Visualization

derlcn via ros-users



Thank you guys,

@spmaniato I'm going to take a look at it, specially the examples :slight_smile:

[quote="shoemakerlevy9, post:4, topic:1691"]
(it would be really nice if I could leave the SMACH viewer open and have it reconnect)
[/quote]

SMACH does not do that? I think it does

[quote="shoemakerlevy9, post:4, topic:1691"]
I control my state transitions with an xbox controller which I find convenient.
[/quote]

how do you do that?






---
[Visit Topic](https://discourse.ros.org/t/state-machine-visualization/1691/5) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [ROS Projects] State Machine Visualization

derlcn via ros-users



[quote="mcamp, post:5, topic:1691"]
SMACH does not do that? I think it does
[/quote]

Hmm tried this again and it does work :slight_smile: I think I've run into scenarios where it doesn't, either that or I'm crazy. Who knows. But thank you, think will help with my debugging.

[quote="mcamp, post:5, topic:1691"]
how do you do that?
[/quote]
I use wireless Xbox controller with a[ wireless dongle](https://www.amazon.com/Microsoft-Xbox-Wireless-Receiver-Windows/dp/B000HZFCT2/ref=sr_1_1?ie=UTF8&qid=1493241801&sr=8-1&keywords=xbox+360+dongle). The ROS package for this is called [joy](http://wiki.ros.org/joy). I then wrote a small python node to publish a string like "stop" or "go_to_kitchen" to the /controller_command topic.

Then I use a [SMACH monitor state](http://wiki.ros.org/smach/Tutorials/MonitorState) to listen to the /controller_cmd topic and transition to a state according to what message it sees.






---
[Visit Topic](https://discourse.ros.org/t/state-machine-visualization/1691/6) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [ROS Projects] State Machine Visualization

derlcn via ros-users
In reply to this post by derlcn via ros-users



[quote="shoemakerlevy9, post:4, topic:1691"]
I am finding SMACH hard to setup and hard to understar
[/quote]

I was re-reading your answer and I notice this (I do not know how I miss this before). Why do you think SMACH is hard to setup and understand?






---
[Visit Topic](https://discourse.ros.org/t/state-machine-visualization/1691/7) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [ROS Projects] State Machine Visualization

derlcn via ros-users



Relative to PLC state machines I find SMACH very difficult to setup and understand. But compared to the spaghetti code that would result with a complex project and no state machine, SMACH is a vast improvement.

In the PLC world there is a very common state machine structure called [PackML](https://en.wikipedia.org/wiki/PackML). Almost all automated manufacturing lines can use this same state machine, modified only slightly. Where I worked there was a file that contained the state transitions and at the top was written DO NOT EDIT THIS CODE! In your own code you set flags which were then used to change the state. You get the hang of it in about a day and then it's very easy to program with. (BTW there is no parallel processing done in PLC's)

Now with SMACH and robotics there is no such common state machine, and its very temping to mix your functional code with the state machine code, making it more difficult to understand. These are two of the major reasons I think I find it confusing, but I do appreciate the fact that SMACH is a much more powerful tool than something like PackML, so it makes sense that its harder to setup and understand.

I think that one day there could be a very common state machine setup using SMACH that does serve as a jumping off place for any robot. For example there may be a 'teleop' state, a 'autonomous' state, a 'pause' state, and a 'recharge' concurrence state would make up a pretty basic state machine that would apply to a lot of robots. I may try to create something like that and post it to github if I have the time. But right now I'm trying to learn FlexBe.






---
[Visit Topic](https://discourse.ros.org/t/state-machine-visualization/1691/8) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [ROS Projects] State Machine Visualization

derlcn via ros-users



For those of you not familiar there's already some interest in integrating with PackML in the ROS-I community.

http://rosindustrial.org/news/2016/7/29/packml-initiative-for-ros-i

I found ROS packages here:

https://github.com/ros-industrial-consortium/packml

As well as a SMACH - PackML integration here:

https://github.com/ros-industrial-consortium/bohr_devel






---
[Visit Topic](https://discourse.ros.org/t/state-machine-visualization/1691/9) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>