How to publish time stamped message from terminal
I would like to create a custom IMU message from terminal (or rqt_publisher). I can publish the message /imu_test and echo it from terminal but I cannot monitor it using rqt_plot. The data doesn't show up.
I think that the problem is because I didn't fill the header properly and my guess is that I didn't state any time info. Please correct me if I am wrong. I can publish a custom /turtle1/cmd_vel the same way I try to publish an IMU message and visualize it without any problem. See the figure below that I can visualize /cmd_vel as -5.0 as I stated and no /imu_test message.
My guess is that the geometry_msgs/Twist doesn't have the header part and doesn't require to specify ROS time explicitly.
I have tried to give a "time" object in the expression by following API documentation. According to that rospy.Time.now()
should create a time instance and I should be able to write Python expressions but it doesn't work. It gives me "# error evaluating as "Time" ".
I am stuck at how to solve the syntax issue or whatever the problem is. I appreciate any help or comment. Thanks.
Could you check whether #q275143 provides an answer?
yes but unfortunately I couldn't make it work. I have tried
ros::Time::now()
,now
,'now'
,'data: { secs: 1, nsecs: 2 }'
,data: { secs: 1, nsecs: 2 }
and many other different silly syntax trials gave me the same error. Whatever I write as a /header/stamp expression, it gives me "# error evaluating as "Time""Please edit your original post and show verbatim copy-pastes of the commands you've tried.
Including verbatim copy-pastes of the error messages you got.
this doesn't really work in any case as that's a C++ expression. You cannot pass those to a Python command line utility which uses YAML as input for message fields.
I don't understand what you want me to edit in my original post. I have already written the python command I tried, I wrote the error I get. And I knew that C++ expression wouldn't work but I just tried to explain that I tried tens of silly commands even if it wouldn't work 99.9% chance. I don't think that it helps if I write down the list of all unsuccessful trials which I have tried so far. In fact, it will make the post way too long unnecessarily.
We don't need to see everything you've tried.
Just show one or two, especially those which are supposed to work according to the documentation.
I cannot help you without you showing what you've done, and the error you get.
where exactly is the command line you used?