ROS Tutorials 3.2

Finally able to compile at least some code examples in VSCode. Working through the tutorials, hoping to finally set the wheels moving on my “robot” - just CORE2+ROS (Tinkerboard) and two motors and encoders. Following code fine, until I get to the step “Build your project and upload it to device”. Build, OK. Upload - that’s where I die.

Web IDE interaction has never worked at all, so not willing to waste more time there. So I have this code, which is built with catkin on the Tinkerboard. But how to load from there on to the Core2? One trivial code test from hFramework (servos) built and uploaded and ran using VScode on a Macbook and uploaded via serial connection, so I know it works.

ROS runs, examples runs except there is obviously nothing alive on the Core2, and even the serial connection from /opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyCORE2 fails to connect.

Can someone help be bridge the gap from compiled program on Tinkerboard to how to download it onto the Core2 and start it running as a member of the ROS world? Vacation quickly slipping away…I just want to see the wheels move and know the twist messages are getting to the Core2.

Thanks for any help.

Did you try with USB cable from Tinkerboard to Core2? As far as I remember somewhere in the forum is described how to copy a compiled program to the Core2.
Found it
Michael

Thanks so much Michael.

I was able to execute this procedure after removing the USB camera (which did work OK with the web IDE). It downloaded OK, but when I run roscore on the Tinkerboard, rosnode list only shows rosout. Is there anything in particular I have to do to kick off the code on the Core2? (Of course, entirely possible that my code is hosed.)

At least the solution to upload from the Tinker to the Core2 is solved in my brain.

Hello Thealy,

Did you run serial bridge?
/opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyCORE2

With running serial bridge, in rosnode list you should get:

/rosout
/serial_node

Regards,
Łukasz

Hi Lukasz-

Yes I did, but with /dev/ttyS1 that I read in another thread (Problem with bridging CORE2 to ROS network - #6 by zielmicha)
I had also run ‘systemctl disable husarion-shield’ and rebooted; when I ran the command I got continual messages like:

Connecting to /dev/ttyS1 at 500000 baud…

But it never connects. Maybe it is just and issue of /dev/ttyS1 vs. /dev/ttyCORE2?

Can you confirm that the start of main should look like below for this configuration?

//platform.begin(&RPi); // comment this line
nh.getHardware()->initWithDevice(&RPi); // change here
nh.initNode();
nh.subscribe(sub);

And also in this case am I OK to run roscore on the Tinkerboard? (I tried that, and also using an external system that was configured with Husarnet as master in earlier attempts to get running)

Thanks for your help. Hoping for a breakthrough this weekend! I will check the /dev/ port used when I get home.

-Terry

Hi Łukasz.

Got home and tried using /dev/ttyCORE2. Different, I think slightly better. Seems to connect, but then repeats these errors every ~15 seconds:
thealy@telepresencebot-2202:~$ /opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyCORE2
[INFO] [1530921558.430174]: ROS Serial Python Node
[INFO] [1530921558.467864]: Connecting to /dev/ttyCORE2 at 500000 baud
[ERROR] [1530921575.582529]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

rosnode list shows both /rosout and /serial_node, but rqt_graph just shows them both as isolated items - no sign of .cmd_vel or /diagnostics as shown in the tutorial.

I ran rosrun teleop_twist_keyboard teleop_twist_keyboard.py and it gives some feedback to the screen, but no action on the motors:

currently: speed 1.82393087469 turn 1.70175442807
currently: speed 2.00632396216 turn 1.70175442807
currently: speed 2.20695635838 turn 1.70175442807
currently: speed 2.42765199421 turn 1.70175442807
currently: speed 2.67041719364 turn 1.70175442807
currently: speed 2.937458913 turn 1.70175442807
currently: speed 2.6437130217 turn 1.70175442807

Blue, green and red LED lit solid - no blinking.

Any suggestions?

Hello Thealy,

According to your change in th code from:

platform.begin(&RPi);
nh.getHardware()->initWithDevice(&platform.LocalSerial);

to

nh.getHardware()->initWithDevice(&RPi); 

you are initializing Core2 to work offline, without connection to cloud. Consequently you need to disable to cloud connection also on TinkerBoard, in command line execute:

systemctl disable husarion-shield

and reboot. Keep in mind, that from now, your device will not be detected by the cloud. You can revert this change with:

systemctl enable husarion-shield

To verify, that you disconnected from cloud successfully:

ls /dev/tty*

You will get list of devices, among others, there will be /dev/ttyS1 and there will be NO /dev/ttyCORE2

Now you can connect:

/opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyS1

As for the ‘rqt_graph’, to see all topics that are published, uncheck Dead sinks and Debug check-boxes on top of the window.

As for the teleop_twist_keyboard output, what you see on screen, is just an information what data is published to cmd_vel topic.

Regards,
Łukasz