[Solved] Trouble bridging core2 to ros

Hi,

I deactivated the husarion cloud using: systemctl disable husarion-shield. But in my opinion I don’t have a service called like this. Anyway after rebooting I still see /dev/tyyCORE2 in the list. It’s not dissappearing like it should be. And I still see my husarion in the cloud that it is online.

To bridge core2 to ros I run after roscore this command: /opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyS1

Sadly it’s returning immediately some errors as shown below.

[INFO] [1530783839.169099]: Protocol version of client is Rev 0 (rosserial 0.4 and earlier), expected Rev 1 (rosserial 0.5+)
[WARN] [1530783840.659726]: Serial Port read failure: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
[ERROR] [1530783842.996374]: Lost sync with device, restarting...
[WARN] [1530783845.333684]: Serial Port read failure: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
[WARN] [1530783849.518403]: Serial Port read failure: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
Traceback (most recent call last):
  File "/opt/husarion/tools/rpi-linux/ros-core2-client", line 89, in <module>
    client.run()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosserial_python/SerialClient.py", line 504, in run
    self.callbacks[topic_id](msg)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosserial_python/SerialClient.py", line 107, in handlePacket
    m.deserialize(data)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/sensor_msgs/msg/_BatteryState.py", line 264, in deserialize
    raise genpy.DeserializationError(e) #most likely buffer underfill
genpy.message.DeserializationError: unpack requires a string argument of length 28

I think it is because the CORE2 is still trying to access the same port as ttyS1 is doing. How can I fix this?

To my setup: I’m publishing twist messages on the /cmd_vel topic which the bridge shall receive and set the speed.

I’m using a Rosbot 2.0 with a tinkerboard.

Thanks for your help

Sobieski

Hello Sobieski,

On new image version there is process named husarnet-configurator that manages the serial port.

Deactivate it with:

systemctl disable husarnet-configurator

Reboot after this command and system will not be connecting to /dev/ttyCORE2 device.

Regards,
Łuaksz

1 Like

Awesome. Thanks a lot. That solved the issue.

Hi,

I would like to reopen this issue.

Randomly I’m getting this error when I try to bridge without the cloud:

By now the only way to get the bridge running is to restart the husarion several times. That’s super annoying. Is there any way to get the reason for this error? Any help is appreciated @lukasz.mitka.
I’ve just updated the whole husarion this morning.

Thanks in advance.

Edit:

I’ve kept reading around here and found a kind of similiar issues: https://community.husarion.com/t/bridging-ros-with-core2-module-unable-to-sync-with-device/463

So I’ll post your asked information from overthere here as well.

  1. Are you programming CORE2 with cloud or using VSC plugin?
    I’m using the VSC plugin and husarion isn’t connected to the husarion cloud.
  2. Output of: systemctl list-units --type service
  3. Output of: ls /dev/tty*
    ls_dev
  4. State of the LEDs on ROSbot rear panel.
    PWR Led lights red. All other Leds aren’t lighting or blinking at all.

Edit 2:

I’ve activated the cloud again and flashed my main.cpp another time with the adjusted code.

→ still getting the same error

Hi Sobieski,

We already investigated problem and we are working on solve it. Fix update will be release as soon as it possible.

Sorry for inconvenience.

Regards,
Hubert

1 Like

Hi Sobieski,

Problem solved :wink: you just have to execute:

sudo apt update
sudo apt dist-upgrade

After that reboot your device and everything should works fine.

We also added a new functionality which allows you to turn on and turn off CORE2 from SBC terminal. It’s just two commands:

sudo set-core2-state on
sudo set-core2-state off

Sometimes it can be very useful :wink:

Regards,
Hubert

1 Like