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

A type of MCU, "TI's DSP TMS320" and rosserial

asked 2021-02-18 02:22:10 -0600

Jaekyungpark gravatar image

updated 2021-04-18 19:11:56 -0600

A type of MCU, "TI's DSP TMS320" and rosserial

I completed the serial setup of TMS320 with "Ti's IDE Code Composer Studio 9.1.0" and confirmed that SCI communication with PC is possible. I set it up according to "rosserial_client tutorials-Adding Support for New Hardware" on roswiki.

But I get the error below. Unable to sync with device, possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

I don't think it's a problem with my code. Could it be due to the size difference the data types?

my MCU(Code composer Studio IDE) - char 2byte / short 2byte / int 2byte / long int 4byte / float 4byte / double 4byte / long double 8byte



Debugging screen of my MCU.
Bold is class
-> is a pointer

Expression     Value

chatter
 ->topic_  0x0000AAF2 "chatter"
 ->msg_  0x0000ACC2{_vptr=0x0000AB7A {delta=0,func=0x00000000}}
 id_    101
 ->nh_   0x0000AD00 {_vptr=0x0000AB9E {delta=0,func=0x00000000}}
 endpoint_ 0

nh
 ->_vptr    0x0000AB9E {delta=0,func=0x00000000}
 hardware_
 rt_time   177395
 sec_offset  0
 nsec_offset  0
 message_in ['\x00','\x00','\x00','\x00','\x00',...]
 message_out ['\xff','\xfe','\x04','\x00','\xfb','\x0a','\x00','\x00','\x00','\x00','\x00','\xf5','\x00','\x00',...]
 publishers
  ->[0]
   ([0])
     ->topic_ 0x0000AAF2 "chatter
     ->msg_ 0x0000ACC2 {_vptr=0x0000AB7A {delta=0,func=0x00000000}}
     id_    101
     ->nh_  0x0000AD00 {_vptr=0x0000AB9E {delta=0,func=0x00000000}}
     endpoint_ 0
 subscribers
  ->[0]
   
([0])
    id_  64
    ->topic_ 0x00000000 "@\307
    ->_vptr  0x00000000 {delta=64,func=0x00000000}
 mode_    0
 bytes_    0
 topic_    0
 index_    0
 checksum_   25107
 configured_   0 '\x00'
 last_sync_time     0
 last_sync_receive_time 0
 last_msg_timeout_time 177412
 param_recieved    0 '\x00'
 req_param_resp
  ->_vptr     0x0000AB16 {delta=0,func=0x00000000}
  ints_length   0 '\x00'
  st_ints     0
  ->ints      0x00000000 {-2067333056}
  floats_length  0 '\x00'
  st_floats    0
  ->floats     0x00000000 {-4.67849048e-36}
  strings_length 0 '\x00'
  ->st_strings   0x00000000 "@\307
  ->strings    0x00000000 {0x84C70040 {0 '\x00'}}

edit retag flag offensive close merge delete

Comments

There is a similar question up right now other question, no answers yet though. Yes the datatype sizes could give you trouble. Different Arduino have different type/sizes as well. For example UNO has 4byte double, while the DUE has 8byte doubles.

Dragonslayer gravatar image Dragonslayer  ( 2021-03-20 04:16:49 -0600 )edit

Check out the other question I mentioned, the user gets a rostopic echo /rosout error regarding the bytes size. You might want to check for this error on your setup, to get a better picture if thats the problem in your case as well.

Dragonslayer gravatar image Dragonslayer  ( 2021-03-24 11:28:11 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2021-04-14 02:36:57 -0600

Jaekyungpark gravatar image

updated 2021-04-18 19:11:11 -0600

Added rostopic echo /rosout message to the post.
In addition, I added my MCU debugging screen to check topic msg.
Can we solve the problem now?

My MCU code, same as Arduino example

#include <ros.h>
#include <std_msgs/String.h>

#include "F28x_Project.h"

__interrupt void SCIB_RxIsr(void);

Uint32 BackTicker=0;

ros::NodeHandle nh;
std_msgs::String str_msg;
ros::Publisher chatter("chatter", &str_msg);

char hello[13] = "hello world!";

void main(void)
{
    nh.initNode();
    nh.advertise(chatter);

    while(1)
    {
        BackTicker++;
        str_msg.data = hello;
        chatter.publish( &str_msg );
        nh.spinOnce();
        DELAY_US(1000*100);
    }
}

When not to use the delay function.

function: "<module>"
line: 86
topics: [/rosout]
---
header:
  seq: 3
  stamp:
    secs: 1618364857
    nsecs: 901356935
  frame_id: ''
level: 2
name: "/serial_node"
msg: "Requesting topics..."
file: "SerialClient.py"
function: "SerialClient.requestTopics"
line: 404
topics: [/diagnostics, /rosout]
---header:
  seq: 2
  stamp:
    secs: 1618364855
    nsecs: 788872957
  frame_id: ''
level: 2
name: "/serial_node"
msg: "Connecting to /dev/ttyUSB0 at 57600 baud"
file: "serial_node.py"
function: "<module>"
line: 86
topics: [/rosout]
---
header:
  seq: 3
  stamp:
    secs: 1618364857
    nsecs: 901356935
  frame_id: ''
level: 2
name: "/serial_node"
msg: "Requesting topics..."
file: "SerialClient.py"
function: "SerialClient.requestTopics"
line: 404
topics: [/diagnostics, /rosout]
---

When using the delay function.

header:
  seq: 6
  stamp:
    secs: 1618365337
    nsecs: 803142070
  frame_id: ''
level: 8
name: "/serial_node"
msg: "Lost sync with device, restarting..."
file: "SerialClient.py"
function: "SerialClient.run"
line: 461
topics: [/diagnostics, /rosout]
---
header:
  seq: 7
  stamp:
    secs: 1618365337
    nsecs: 809052944
  frame_id: ''
level: 2
name: "/serial_node"
msg: "Requesting topics..."
file: "SerialClient.py"
function: "SerialClient.requestTopics"
line: 404
topics: [/diagnostics, /rosout]
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-02-18 02:18:29 -0600

Seen: 313 times

Last updated: Apr 18 '21