ros_pipe
raimdelgado / ros_pipe Goto Github PK
View Code? Open in Web Editor NEWXenomai 2.6.5 and ROS Indigo Igloo
Xenomai 2.6.5 and ROS Indigo Igloo
ros_pipe
Hi, I'm currently trying to build a application binding Xenomai RT threads to ROS NRT nodes, and I'm facing difficulties when it comes to exchanging floating points :
Note that I am not using rt_read
but rcvfrom
!
A snippet :
// ROS Side
char fwd_buffer[64];
sprintf(fwd_buffer, "%.2f %.2f %.2f", px, py, oz);
// Printf fwd_buffer returns "2.10 3.80 6.40" => usable floats
this->ret = write(this->fd, fwd_buffer, this->ret);
if (this->ret <= 0) this->fail("write");
// Xenomai Side
float l_dist = 0., f_dist = 0., r_dist = 0.
ret = recvfrom(s, buf, sizeof(buf), 0, NULL, 0);
if (ret <= 0) fail("recvfrom");
sscanf(buf, "%f %f %f", &l_dist, &f_dist, &r_dist);
rt_printf("%s => [%.2f | %.2f | %.2f] echoed by peer\n", __FUNCTION__, l_dist, f_dist, r_dist);
Turns out rt_printf only prints the first float, because the buffer buf
only contains the first float and the first space...
Not sure why the buffer is not fully charged by what was send by the ROS node when calling recvfrom, and I'm seeking guidance, since you basically did something very similar !
Thanks !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.