For this section, ROS command line tools were used in order to determine information about a previously unanalyzed package.
- The node
ros_cl_democontains one publisher and one subscriber. - The names of the topics were found by using the
rosnode infotool. These topics are/demo_publish_topicand/demo_subscriber_topic. - Running
rostopic echocauses the messages for a topic to be printed to the screen. The message can be further analyzed usingrosmsg show. * The/demo_publish_topicpublishes a message which contains an integerseqwhich increments by one each time a new message is published, a timestamp, a string containingframe_id, a float containingtime, and a float containingconfiguration* The/demo_subscriber_topicsubscribes to a message which contains a Stringdata. - Message packages were found by running
rostopic infoon each node. The/demo_publish_topicis of typeME495Pubwhile the/demo_subscriber_topicis of typestd_msgs/String. - The publisher
/demo_publish_topicpublishes data at around50 Hz. This rate was determined by using therostopic hztool. - The
/demo_publish_topicdata was was plotted usingrqt_plot /demo_publish_topic. From the plot, the topic is publishing configuration data that oscillates in a sinusoidal waveform from -10 to 10. It also publishes time data that increases linearly as expected. - A message of type
std_msg/Stringis published using therostopic pubtool. The subscriber inverts the order of the characters in the input string and the manipulated string is printed to the terminal where the node is running. For example, typing:
rostopic pub /demo_subscriber_tic std_msgs/String "Hello"
Results in the following being printed to the node terminal:
[ INFO] [1476045302.234362951]: Manipulated String: olleH
- The node
ros_cl_demoalso contains one service provider. - The names of service providers can be found using
rosservice list. The node contains a unique service/me495_math_serverin addition to the usual logging servers. - The service description can be found using
rosservice info. The service is of typeme495_hw1/ME495Srv. More information about this type can be found using therossrv showtool. Theme495_hw1/ME495Srvservice type requests an unsigned 32 bit integer as an input and outputs an unsigned 8 bit integer. - The service can be called using the
rosservice calltool. This service returns the number of digits of the input argument.
The purpose of the figure8 package is to interface with the existing turtlesim package in order to make the turtle follow a reference trajectory.
The node figure8_node.py serves two purposes:
- It calls teleport_absolute_client(x, y, theta) which initializes the turtlebot by teleporting it to a location defined by
x, y, theta. The client calls the/turtle1/teleport_absoluteservice provided by the turtlebot package. - Then, it calls control_turtle which calculates the control for the turtle and publishes these values to
turtle1/cmd_velusinggeometry_msgs/Twist.msg. * The reference trajectory for the turtlebot is given by:Xd(t) = 3sin(4*pi*t/T) Yd(t) = 3sin(2*pi*t/T) For t = [0,T]* Only the magnitudes of the linear and angular velocities of the turtlebot at a given point are used to control the turtlebot's kinematics. The equations used to calculate these magnitudes were found by solving for v and w from the governing equations:x' = vcos(theta) y' = vsin(theta) theta' = w
figure8_node.pycontains a private parameter, T, which can be used to control the period of the reference trajectory at runtime. If no value for the private parameter is specified, it defaults toT = 10.- The bag file 2016-10-09-13-49-24.bag contains message data which can be used to playback 30 seconds of reference trajectory tracking without starting up
figure8_node.py.