convert simulink to rosserial
Hi, I've been trying to write Rosserial Arduino script on a tight timeline and I am struggling with writing the script. This is this first time working with arduino as part of a group that haven't worked with ROS.
A simulink model of what I'm trying to achieve is posted here:
Is there some way of converting this into script automatically? I've done the blinker and chatter publishing and subscribing tutorials on the wiki but they aren't clear how to extract the specific messages from the topic. eg. within local_plan: x = Poses.Pose.Position.X z = Poses.Pose.Position.Z
And also how to collect the xyz vel/accel IMU data and collect into a Topic.
Sorry if this is a few questions at once but help would be greatly appreciated. I can comment the code that I've tried writing but it is just adapted from the blinker and chatter tutorials and is pretty incoherent.
rosserial
is not a generic transport for ROS messages, but requires both sides to be usingrosserial
. Are both sides doing that?And you have 13 karma, please attach images directly to the question. Do not link to off-site hosting.
Yeah that was something I couldn't find an explicit statement of. Do you mean I should have a file on the ROS computer stating that the arduino should be treated as a node e.g. > rosrun rosserial_arduino serial_node.py _baud:=500000 _port:=/dev/ttyUSB0 And then another script on the board itself with the pub/sub commands on? Or something else? Thanks
I've reported the failing image uploads: ros-infrastructure/answers.ros.org#192.
on both sides you need to be using
rosserial
. Otherwise it won't work.So I guess the answer to your question would be: yes.
But afaik, the generated code from simulink doesn't use
rosserial
, so that wouldn't work.Oh okay, yeah I wasn't sure if there was a shortcut I could take. So if I write using Rosserial Arduino is it sufficient to have the roslib and in the header include: -#include <ros.h> -#include <std_msgs string.h=""> ros::NodeHandle nh;
I don't understand your last comment.