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

Are there different ways to control an Arduino instead of using the Terminal?

asked 2015-03-21 13:04:10 -0600

Johan gravatar image

updated 2016-04-10 10:46:07 -0600

130s gravatar image

At the moment I am using ROS-serial and an Arduino robot, which is connected via USB to the computer. The control is based on sending commands through the Terminal. Just like that :rostopic pub Roll std_msgs/Empty --once.

I am not very familiar with ROS, so I would like to ask if there other ways or alternatives that you guys have experience with or would suggest? Maybe is there way like using the Serial monitor? But I've read that is not possible !?

I would be appreciate for any help or suggestions,

Thanks ,

Johan


Edit:

I suggest you to explain more your architecture and your goal.

My goal is to control a robot via openHAB. openHAB has an event Bus middleware, which comes with an openHAB runtime server. This system provides several bindings to be able to communicate with the hardware side. My first use case is to connect my Arduino robot to openHAB and is based on a serial binding or tcp binding. Controlling the robot is by clicking a button openHAB (GUI), which sends chars to the robot. Because of these bindings , there is already a connection between my robot and openHAB.

Now what I am trying to do is basically the same thing, but this time I am using ROS+Arduino. The ROS Arduino works fine with the rosserial. In this case we have two servers, which are running in the same time. 1. OpenHAB and 2. ROS. So I am thinking about a way to bypass using rostopic.

edit retag flag offensive close merge delete

Comments

1

@Johan: I've removed your answer (which was more of a comment) and updated your original question with the new information. For future reference: please use answers only to post answers, and comments for discussing answers. Everything else -> update original question.

gvdhoorn gravatar image gvdhoorn  ( 2015-03-23 07:28:25 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-03-22 15:43:31 -0600

updated 2015-03-23 13:12:27 -0600

Dear Johan, not sure to understand correctly your question. Are you looking a friendly way to publish topics on ROS in order to control your robot easily? If yes I think some kind of teleop is what you need. Here you can find a good start point: this node look for pressed key on the keyboard a public a /cmd_vel topic according to pressed arrow key. Of course you can modify this code in order to publish any topic you need.

Faster (but dirty) solution is to define alias for commands like posted one: with this approach you have to type only a short alias instead the complete command. Here) you can find more info about aliases.

I really suggest you the first way: you can take advantage of the opportunity to be more familiar with ROS world!

EDIT:

Tell me if my understanding is correct. You was using Arduino + OpenHAB connected via serial port. You was able to control your robot via a GUI developed in OpenHAB. Now you introduce ROS that use the same serial port to make able Arduino to communicate to ROSCore and you are looking to another way to put OpenHAB in the equation.

That's right?

EDIT:

Since you have only one serial port you cannot connect Arduino to OpenHAB and ROS at same time. In my opinion serial port must be used by ROS. OpenHAB can send command to Arduino passing by ROS: OpenHAB must publish a topic in ROS that is subscribed by Arduino code. In the opposite way, in order to show some infos on GUI provided by Arduino, you should publish some topics from Arduino code subscribed by OpenHAB node. I'm doing something similar on my project: a Java SW provide the GUI and publish/subscribe ROS topic in order to interact with the robot. See here for OpenHAB integration in ROS.

edit flag offensive delete link more

Comments

First of all thank you for your advice. I actually looking an easy way to control a robot. For example hitting a button without typing a command like using the serial nodes. Just like the serial monitor for Arduino. Basically I don't want to control my robot via terminal.

Johan gravatar image Johan  ( 2015-03-22 17:16:42 -0600 )edit

Btw. Is it true that is not possible to connect ROS to MQTT server?

Johan gravatar image Johan  ( 2015-03-22 17:17:08 -0600 )edit

I think you have to explain better... which is the difference from terminal and Arduino serial monitor? They looks very similar for me! Or do you mean that you want to control you robot without publishing a ROS topic? I suggest you to explain more your architecture and your goal.

afranceson gravatar image afranceson  ( 2015-03-23 02:48:42 -0600 )edit

That is correct. At the moment I am able to use the terminal by sending commands to the arduino+ROS robot. And now I try to look for away to use a similar that I did with Arduino (without ROS) before. So Basically using openHAB to control ROS robots.

Johan gravatar image Johan  ( 2015-03-23 09:39:58 -0600 )edit

Alright thanks for the advice. I've already tried the openHAB bridge, but I haven't figured it out how The bridge will recognize the robot. Even If the openHAB has access to the robot by using bindings. Because it does not updated the events on the bridge.

Johan gravatar image Johan  ( 2015-03-24 17:54:54 -0600 )edit

Question Tools

Stats

Asked: 2015-03-21 13:04:10 -0600

Seen: 702 times

Last updated: Mar 23 '15