You should create your own node that will do this. You can do this in c++ or python.
Follow the Writing a Simple Publisher and Subscriber tutorial that teaches you how to make a publisher and subscriber node. You are only concerned with making a publisher node, but if you haven't done these tutorials, you should.
Here's the c++ version: http://wiki.ros.org/ROS/Tutorials/Wri...
Here's the python version: http://wiki.ros.org/ROS/Tutorials/Wri...
Here is an example with UNTESTED CODE of how you would do this in c++:
#include "ros/ros.h"
#include "geometry_msgs/Twist.h"
int main(int argc, char **argv)
{
ros::init(argc, argv, "talker");
ros::NodeHandle n;
// Advertize the publisher on the topic you like
ros::Publisher pub = n.advertise<geometry_msgs::Twist>("my_topic_name", 1000);
while (ros::ok())
{
/**
* This is a message object. You stuff it with data, and then publish it.
*/
geometry_msgs::Twist myTwistMsg
// Here you build your twist message
myTwistMsg.linear.x = 1;
myTwistMsg.linear.y = 2;
myTwistMsg.linear.z = 3;
ros::Time beginTime = ros::Time::now();
ros::Duration secondsIWantToSendMessagesFor = ros::Duration(3);
ros::Time endTime = beginTime + secondsIWantToSendMessagesFor;
while(ros::Time::now() < endTime )
{
pub.publish(msg);
// Time between messages, so you don't blast out an thousands of
// messages in your 3 secondperiod
ros::Duration(0.1).sleep();
}
return 0;
}