HumanoidPequi / HumanoidPMec_LARC2023

1 stars 1 forks source link

Rosserial #7

Closed lucasolives closed 1 year ago

lucasolives commented 1 year ago
  1. Open up terminal and type: roscore
  2. In a new terminal type: rosrun rosserial_arduino serial_node.py _port:=/dev/ttyUSB0
  3. Type rostopic list to make sure that everything is running
lucasolives commented 1 year ago

[ERROR] [1684614705.969329]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

lucasolives commented 1 year ago

Possible solution: If rebuilding isn't an option you can add the definitions manually. On the arduino side you'll have a ros_lib folder. You have two sub directories you need to change.

The first is ./ros/node_handle.h. At the top of the file you'll see a few protocol versions defined as const uint8_t. Add in the version id for noetic as const uint8_t PROTOCOL_VER6 = 0xfa; then change the line that states what version should be used. const uint8_t PROTOCOL_VER = PROTOCOL_VER6;.

Lastly, you just need to make this same change in ./ros_lib/ros/node_handle.h

Update: Defining #define USE_USBCON worked Update1: Working while defining #define USE_USBCON was only a coincidence

lucasolives commented 1 year ago

The code controle_baixo_nível.ino is being developed, so it has some things that need to be fixed. 1 - servo_cb() is able to receive only one angle when it should get two. Possible solution: Create a custom_msg package that contains two UInt16 values 2 - It's necessary to review the conversion of unsigned integer data type. The goal is that Esp32 receives uint8_t, so it's necessary to make some conversions during the code and i'm not sure if it's good enough or if it works.

dimitriasilveria commented 1 year ago

Dynamixel to arduino download: https://www.arduinolibraries.info/libraries/dynamixel2-arduino

andrecaraiba commented 1 year ago

This tutorial solved the problem: https://answers.ros.org/question/394805/esp32-keep-rebooting-with-rosserial/