A type of MCU, "TI's DSP TMS320" and rosserial
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
rttime 177395
secoffset 0
nsecoffset 0
**messagein ['\x00','\x00','\x00','\x00','\x00',...]
messageout ['\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'
lastsynctime 0
lastsyncreceivetime 0
lastmsgtimeouttime 177412
paramrecieved 0 '\x00'
reqparamresp
->vptr 0x0000AB16 {delta=0,func=0x00000000}
intslength 0 '\x00'
stints 0
->ints 0x00000000 {-2067333056}
floatslength 0 '\x00'
stfloats 0
->floats 0x00000000 {-4.67849048e-36}
stringslength 0 '\x00'
->st_strings 0x00000000 "@\307
->strings 0x00000000 {0x84C70040 {0 '\x00'}}
Asked by Jaekyungpark on 2021-02-18 03:18:29 UTC
Answers
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]
Asked by Jaekyungpark on 2021-04-14 02:36:57 UTC
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.
Asked by Dragonslayer on 2021-03-20 04:16:49 UTC
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.
Asked by Dragonslayer on 2021-03-24 11:28:11 UTC