Ask Your Question
0

Multiple Python-Scripts (Turtlebot2 / Kobuki) in kobuki_node

asked 2017-10-23 02:37:46 -0600

glukon gravatar image

Hi guys,

I have multiple python scripts for several tasks. Let's assume: The first one is for driving a certain distance with a given speed. Another one is for image processing purpose (marker detection). A third could be used to find a docking station and so on...

Everything is running on a Jetson TK1 (ubuntu 14.04 - Linux4Tegra) => ros indigo with a poor Turtlebot2 setup (I don't use the depth camera). On the Jetson TK1 I copied the kobuki_node to my catkin workspace and added a camera node to the kobuki nodelet (gscam) via launchfile. For running I start minimal.launch and call python scrips by command: rosrun kobuki_node mypython.py. It's possible to call "driveDistance.py" and then in parallel run the image processing routine and so on.

Now I want to put everything together like a state machine. For this I tried to write a nohup bash script, starting each script in the background till it ends by itself or killing by process id. But hey, I think with some help I can find a better solution. Can we?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-10-23 02:55:48 -0600

gvdhoorn gravatar image

updated 2017-10-23 02:57:09 -0600

You're looking to add some coordination to your system.

See wiki/flexbe or its precursor wiki/smach to get started.

Other possibilities: py_trees_ros (very nice), pi_trees, behavior_tree and decision_making (bit old perhaps).

If you search around, you'll probably find some more alternatives, but this should get you started.

edit flag offensive delete link more

Comments

1

Note: your bash scripts (and you) essentially implemented a form of manual coordination. I'd recommend to get into the automated varieties as supported by the frameworks I linked to. It'll be a bit of a learning curve, but much more flexible, maintainable and scalable.

gvdhoorn gravatar imagegvdhoorn ( 2017-10-23 02:56:52 -0600 )edit

Thanks so far! Since I'm using a virtual machine for devel, ros master is running on the Jetson TK1 and the project yet is pretty small. I don't need a huge tool, and I don't have time for doing research and so on... Hope you get me at this point. Any ideas which one I should start with?

glukon gravatar imageglukon ( 2017-10-23 07:54:33 -0600 )edit

I'm not sure I follow: how does that factor in when modelling your behaviour with the proper tools / infrastructure?

gvdhoorn gravatar imagegvdhoorn ( 2017-10-23 07:55:39 -0600 )edit
1

I don't need a huge tool, and I don't have time for doing research and so on..

this was not part of your original question, so I just listed some frameworks / modelling tools I know about.

You could probably very quickly try out flexbe: it's well documented and has nice examples.

gvdhoorn gravatar imagegvdhoorn ( 2017-10-23 07:59:35 -0600 )edit

But anything more structured than a set of shell scripts will probably require some time to get into. I think that's inevitable.

gvdhoorn gravatar imagegvdhoorn ( 2017-10-23 08:00:09 -0600 )edit

Well, I have no idea about the tools you mentioned beeing used for behaviour modelling. To make it a bit more clear, which one is easy? Which one would cost the most time reading and going through tutorials?

glukon gravatar imageglukon ( 2017-10-23 08:00:55 -0600 )edit

Sorry for edit! Then I will try starting with flexbe :-) Thanks a lot!!

glukon gravatar imageglukon ( 2017-10-23 08:01:57 -0600 )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

3 followers

Stats

Asked: 2017-10-23 02:37:46 -0600

Seen: 253 times

Last updated: Oct 23 '17