Get error when trying to publish float64 arm message
Get an error(see below) when trying to publish a float64 arm command.
Using Ubuntu 12.04.1 Ros Hydro
source file:
#include "ros/ros.h"
#include <std_msgs/Float64.h>
#include "pub/ArmPan.h"
pub::ArmPan panmsg;
int main(int argc, char **argv)
{
ros::init(argc, argv, "pub");
ros::NodeHandle n;
ros::Publisher ArmPan_pub = n.advertise<std_msgs::Float64>("ArmPan/command", 1000);
ros::Rate loop_rate(10);
int count = 0;
while(ros::ok())
{
panmsg.ArmPan = 1.0;
ArmPan_pub.publish(panmsg);
ros::spinOnce();
loop_rate.sleep();
++count;
}
return 0;
}
the file ArmPan.msg has one line: float64 ArmPan
rosrun fails with this err:
[FATAL] Assertion failed
file = /opt/ros/hydro/include/ros/publisher.h
line 115
cond = impl_->md5sum == "*" || std::string(mt::md5sum<M>(message))
== "*" || impl_->md5sum == mt::md5sum<M>(message)
Trying to publish message of type [pub/ArmPan] on a publisher with type [std_msgs/Float64]
if the message
rostopic pub -1 ArmPan/command std_msgs/Float64 1
is entered, it works.
This code worked in earlier versions of ROS but now fails with Hydro. Can you tell me why? Thanks.