Giter Club home page Giter Club logo

ros_pipe's Introduction

ros_pipe

ros_pipe's People

Contributors

raimdelgado avatar

Watchers

 avatar

ros_pipe's Issues

XDDP : not getting full buffer

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 !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.