#1 2016-07-13 06:38:21

brjapon
Member
Registered: 2016-07-13
Posts: 1

Launch ROS processes in Intel Edison

Although I have followed the steps in http://plen.jp/playground/wiki/tutorial … s_tutorial I do not get that the PC connects to the ROS_MASTER_URI.
Furthermore, this post only explains how to create a sample script, but does not tell how to launch ROS in Plen2 to be able to run it.
Could please add the steps to?:
* Ensure the PC to connect to the ROS_MASTER_URI
* Launch ROS processes in PLEN2
* Launch ROS processes in control PC for running the blink LED script

Thanks in advance

Offline

#2 2016-07-17 11:58:42

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Hi, brjapon

* Ensure the PC to connect to the ROS_MASTER_URI
I found a small mistake in the tutorial.
Try setting ROS_MASTER_URI with "http://" like this:
  export ROS_MASTER_URI=http://192.168.42.1:11311
To make sure that the PC is connected to the master process in the PLEN2,
run
  $ rostopic list
on the control PC, for example.

* Launch ROS processes in PLEN2
If you want to launch ROS processes in PLEN2 automatically,
add a command to run your script to
  /home/root/plen-dev.sh

* Launch ROS processes in control PC for running the blink LED script
As the tutorial says:
  $ python <CREATED_SCRIPT_NAME>

I think ROS is fun as well as PLEN2. Let's enjoy!


wingcloud

Offline

#3 2016-08-17 00:11:39

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

hi,

i am facing problem to re-connect to my PLENDEV via WIFI after i done the first two export command.

export ROS_IP=<PC_IP_ADDRESS>  -- (done)
export ROS_HOSTNAME=<PC_IP_ADDRESS> -- (done)
export ROS_MASTER_URI=http://192.168.42.1:11311 -- (not done and the PLENDEV communication stop)

i now cant connect back to my PLENDEV with the original local wifi connection through my local router.
its seem like after export command the PLENDEV LED (both eyes) are blinking on and off.

appreciate if you can help on getting me back to the robot communication.  thanks

Offline

#4 2016-08-17 04:00:52

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Hi, ylee12

Do you mean you ran your first two export commands on your control PC
and suddenly it lost the connection with PLENDEV?
That sounds very strange.
Your export commands couldn't affect your wifi connection
because they just set some environment variables of ROS.

I'm afraid your PLENDEV and PC have another problem.
Did you surely connect your PLENDEV to the router?
By default, our PLENDEV makes his own local wifi network.
(SSID:PLEN2devXXXX)


wingcloud

Offline

#5 2016-08-17 07:05:21

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

hi Wingcloud,

what i did was, i connect the SSID : Plen2devxxxx first, then i register the Plen2dev to my local router and associate it to a local IP which assigned by my router through DHCP.  I use the new DHCP ip to connect to Plen2dev via Putty.  i have the userid: root and password as plenproject for access.  I manage to access to the root directory.  The next step i did was to export the ROS IP and ROS hostname with the local IP address assigned by DHCP.   the moment i export the hostname, before i can export the ROS_MASTER_URI, the connection to my putty lost and i cant ping the Plen2dev anymore.

do you know if there a way to recover the communication to the Edison on the head board ?  thanks in advance

Offline

#6 2016-08-17 10:16:40

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Hi ylee12,

I see...
You might fail to configure the auto-connection of your plendev to your local router
and your plendev rebooted unintetionally. Can't you find the PLEN2devxxxx network either?
If not so, you need Arduino expansion board or mini breakout board to recover, in my understanding.
FYI:
https://plen.jp/playground/forum/viewtopic.php?id=67
https://software.intel.com/en-us/connec … t-over-usb

To tell the truth, I was obliged to buy a mini breakout board for my plendev, but it was worth buying for me.

Last edited by wingcloud (2016-08-17 10:46:02)


wingcloud

Offline

#7 2016-08-17 15:31:37

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

hi Wingcloud,

i manage to get communication back to my PLEN2dev after reset. what i notice is when i check the environment with "env" command, i notice below response from the Edison:

root@PLEN2devxxxxx:~# env
TERM=xterm
SHELL=/bin/sh
ROS_ROOT=/opt/ros/indigo
SSH_CLIENT=192.168.1.94 62991 22
ROS_PACKAGE_PATH=/opt/ros/indigo/share
ROS_MASTER_URI=http://192.168.42.1:11311
OLDPWD=/home/root/catkin_ws
SSH_TTY=/dev/pts/0
USER=root
LD_LIBRARY_PATH=/opt/ros/indigo/lib
MAIL=/var/mail/root
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/ros/indigo/bin:/usr/local/libexec/bluetooth/
PWD=/home/root
EDITOR=/bin/vi
ROS_HOSTNAME=192.168.42.1
NODE_PATH=/usr/lib/node_modules/
PS1=u@h:w$
SHLVL=1
HOME=/home/root
ROS_DISTRO=indigo
PYTHONPATH=/opt/ros/indigo/lib/python2.7/site-packages
LOGNAME=root
ROS_IP=192.168.42.1
SSH_CONNECTION=192.168.1.94 62991 192.168.1.75 22
CMAKE_PREFIX_PATH=/opt/ros/indigo
_=/usr/bin/env

with this setting, has the ROS installed successfully ? what are the next steps i need to work on in order to get my PLEN2dev to be able to run with ROS ? 

p/s: 192.168.1.175 - DHCP IP assigned by my local router through wifi.
       192.168.1.94 is - DHCP IP assigned for my laptop

thanks for the prompt response.

Offline

#8 2016-08-18 12:26:47

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Hi ylee12,

I'm glad to hear your plen has recovered. Congrats!

In our plendev, ROS is running by default.
But because you changed the network setting, you need to reconfigure several ROS environment variables of your plendev as follows:
ROS_MASTER_URI=http://192.168.1.175:11311
ROS_IP=192.168.1.175
ROS_HOSTNAME=192.168.1.175

I recommend you reboot your plendev once here.
Your laptop should bet set as follows:
ROS_MASTER_URI=http://192.168.1.175:11311
ROS_IP=192.168.1.94
ROS_HOSTNAME=192.168.1.94
(If you haven't installed ROS to your laptop, please install it.)

Then, your plendev and laptop must be in one ROS system now.
To make sure of it, please run
laptop> rostopic list
You will receive the list of topics in your ROS system like this:
/BleToControl
/ControlToBle
/ControlToGpio
/ControlToI2c
/ControlToSerial
/GpioToControl
/I2cToControl
/PcToControl
/SerialToControl
/rosout
/rosout_agg

How about controlling the LEDs of your plen from your laptop for the next step?
LED ON:
laptop> rostopic pub -1 /PcToControl std_msgs/String -- "gpio,w,on"
LED OFF:
laptop> rostopic pub -1 /PcToControl std_msgs/String -- "gpio,w,off"

Enjoy!


wingcloud

Offline

#9 2016-08-22 13:41:45

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

thank you wingcloud.  appreciate your guidance

Offline

#10 2016-09-20 15:35:28

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

hi Wingcloud,

i manage to get the ubuntu installed in my laptop, but when when i run "rostopic list" in my ubuntu,  the error message of "un-able to connect to master" come out.  i tried in both root and catkin directory and its failed.  i have done the env setup as proposed below:
plendev:
ROS_MASTER_URI=http://192.168.1.175:11311
ROS_IP=192.168.1.175
ROS_HOSTNAME=192.168.1.175

laptop :
ROS_MASTER_URI=http://192.168.1.175:11311
ROS_IP=192.168.1.94
ROS_HOSTNAME=192.168.1.94
...
i also tried to run the command from the Plendev using putty line :
laptop> rostopic pub -1 /I2cToControl std_msgs/String -- "gpio,w,on" 

and its works now but my plendev is kind of stuck at this LED blink ... is there a way for me to gain control back to Plendev ?
now i lost the connection to my PlenDev, IP ping doesnt seem to work now and putty connection lost to PlenDev

thanks for the great helps

Offline

#11 2016-09-26 23:20:23

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Hi ylee12,

Sorry for my very late response.
Your ROS setting seems to be correct. I don't know why your laptop couldn't connect to the master...
If you often lose the connection to your plendev, I recommend you to check your network setting up.
That's all I come up with. But the network trouble is always nightmare, isn't it? :(
I'm sorry that I wasn't very helpful.

> i also tried to run the command from the Plendev using putty line :
> laptop> rostopic pub -1 /I2cToControl std_msgs/String -- "gpio,w,on"
> and its works now but my plendev is kind of stuck at this LED blink ... is there a way for me to gain control back to Plendev ?

You don't need to do anything special. It's enough to turn LED off:
  rostopic pub -1 /I2cToControl std_msgs/String -- "gpio,w,off"
Plendev is always waiting for your command even before your first command by ROS(ROS message).
More precisely, the process called "ControlNode" of plendev is watching these topics
and receives various commands through them:
/BleToControl
/GpioToControl
/I2cToControl
/PcToControl
/SerialToControl


wingcloud

Offline

#12 2016-09-27 02:57:04

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

thanks again Wingcloud for the helps.

yes, i finally figured out the error was cause by one of the batch file that export the MASTER_URI to 192.168.42.1 and i corrected the server address, its can start the roslaunch plen.launch properly and my laptop can perform the rostopic list properly.

just one challenge i facing now is the roslaunch some how stuck at the bleNode.py which causing the error of 
" bluetoothd : failed to read advertising features: xxxxxx
" bluetoothd : hci0 load connection parameters failed : unknown command (0x01)
.........

do i need to setup a BLE donggle to get the Plen bluetooth connected correctly ?  how do i pair the device with plen so that the communication started ?  i plan to use BLE to trigger plen "wake up"  is there a way to do so ?

thanks for the advice again .

Offline

#13 2016-09-27 05:37:07

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Hi ylee12,

>  i plan to use BLE to trigger plen "wake up"  is there a way to do so ?
It must be cute! I believe it's not so difficult, theoretically.

First, you need to ensure to connect your ble device to the intel edison of your plendev somehow.
[BLE device]->[Intel Edison(plendev)]-[Control Board(plendev)]
You can find some good guides about it online.
For example:
https://software.intel.com/en-us/articl … tel-edison

Then, it's ok to write a small ROS program to publish a ROS message to the /BleToControl topic when the BLE event is caught.
[BLE device]->[Intel Edison(plendev)]->[Control Board(plendev)]

I would be happy if it's of some help.


wingcloud

Offline

#14 2016-09-27 16:37:47

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

hi Wingcloud,

i manage to run the LED blink command smoothly now as follow:
LED ON:
laptop> rostopic pub -1 /PcToControl std_msgs/String -- "gpio,w,on"
LED OFF:
laptop> rostopic pub -1 /PcToControl std_msgs/String -- "gpio,w,off"

but when i try to play a motion to robot, its doesnt move at all,  is the command i used below correct ?
rostopic pub -1 /PcToControl std_msgs/String -- "serial,w,$pm04"

do i miss out anything in order to play the motion ?

thanks

Offline

#15 2016-09-27 17:44:11

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Hi ylee12,

try:
rostopic pub -1 /PcToControl std_msgs/String -- 'serial,w,$pm04'

bash may consider $xxx in double quotes as an environment variable.


wingcloud

Offline

#16 2016-09-27 22:18:00

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

hi wingcloud,

i tried
rostopic pub -1 /PcToControl std_msgs/String -- 'serial,w,$pm04'
rostopic pub -1 /GpioToControl std_msgs/String -- 'serial,w,$pm04' etc ...

and each of the control topic too,  its doesnt seem working.  need help to let me know if i have missed anything ?
thanks for the great helps

Lee

Offline

#17 2016-09-28 03:47:34

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Hi ylee12,

Hmm.. It worked for my plendev.
As the tutorial says, 'serial,w,$pm04' means 'play the motion in the slot #4'.
The slot #4 of your plendev may be empty.

How about other slots?
Or you can try (re)installing motions into your plendev by motioninstaller.


wingcloud

Offline

#18 2016-09-28 15:30:40

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

hi Wingcloud, 

i reinstall all the motion and its seem not working as well,  what will cause such issue ? GPIO is working but play motion is not working ?

in fact i run the rostopic pub command from the putty connection in the plen2Dev.  is this matter ? do i need to run from my ubuntu ROS ?
by the way i notice there is 2 connectors from the Plen head board to the arduino controller board, is the connection of the between headboard and controller board matter ?  which one i should attached to ?

thanks and really need help on this .

Lee

Offline

#19 2016-09-28 22:41:13

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Hi Lee,

>in fact i run the rostopic pub command from the putty connection in the plen2Dev.  is this matter ? do i need to run from my ubuntu ROS ?
It does not matter at all.

>by the way i notice there is 2 connectors from the Plen head board to the arduino controller board, is the connection of the between headboard and controller board matter ?  which one i should attached to ?
I'm using the left one. If you can control your plendev by the PLENconnect, it must be OK.

In the plendev please run
  rostopic echo /BleToControl
and tap the 'bow' motion in the PLENconnect, then you will get a message on your console like this:
>data: serial,w,$MP04
>---
>data: gpio,w,act
>---
(If you don't get anything, please tap several times.
I don't know why, but sometimes it seems to fail to show these messages.)
This means the message 'serial,w,$MP04' was sent on the topic /BleToControl.
And your plendev read them and bowed, didn't he/she?
So, if you send the same message on the same topic, your plendev must bow.
  rostopic pub -1 /BleToControl std_msgs/String -- 'serial,w,$MP04'

Take it easy.

Last edited by wingcloud (2016-09-28 22:47:54)


wingcloud

Offline

#20 2016-09-29 11:28:42

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

hi Wingcloud,

i have tried swap the connector on the head board too.  its seem like my case have no issue to turn on and off of the LED (Edison board) but when i need to control the arduino board, its has problem to issue command to the board.  do you know if there is a way to debug this ? how can i know if the connection is made successful ?

is there any command to initialize the arduino board before command can be issued ?


thanks
Lee

Last edited by ylee12 (2016-09-29 11:30:00)

Offline

#21 2016-09-29 12:47:03

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Hi Lee,

Can you get your plendev to move by the PLENconnect?


wingcloud

Offline

#22 2016-09-29 14:10:27

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

hi wingcloud,

i tried and can not,  it was never able to control my PLEN2Dev using PLENconnect (from andriod app).. 

does this indicate something wrong with the control board  from Edison ?  however when i use USB connection and motion editor from laptop (with server running)  it can move.

thanks
Lee

Offline

#23 2016-09-30 07:36:34

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Hi Lee,

I see. You can control your plendev's motion through USB connection,
but you cannot do through BLE/Wifi connection.
Because the control board has the USB connector and the Edison has BLE/Wifi chip,
the connection between the control board and the Edison is most suspicious.

Is it from the beginning? It is likely hardware trouble, I suppose.
You can check the cable by your multimeter of course,
but how about consulting the official support team first?


wingcloud

Offline

#24 2016-09-30 07:40:38

ylee12
Member
Registered: 2016-04-19
Posts: 15

Re: Launch ROS processes in Intel Edison

thanks for the great help wingcloud,  is there an email contact i can send request to ?  i need urgent helps on this too....

appreciate your great support

Lee

Offline

#25 2016-09-30 07:55:19

wingcloud
Moderator
Registered: 2016-05-26
Posts: 24

Re: Launch ROS processes in Intel Edison

Plz send to:
  support@plen.jp


wingcloud

Offline

Board footer

Powered by FluxBB