Skip to content

BlakeStrebel/Figure-Eight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ROS Command Line Tools, and Publisher/Subscriber Challenge

ROS Command Line Tools and Package Analysis

For this section, ROS command line tools were used in order to determine information about a previously unanalyzed package.

  1. The node ros_cl_demo contains one publisher and one subscriber.
  2. The names of the topics were found by using the rosnode info tool. These topics are /demo_publish_topic and /demo_subscriber_topic.
  3. Running rostopic echo causes the messages for a topic to be printed to the screen. The message can be further analyzed using rosmsg show. * The /demo_publish_topic publishes a message which contains an integer seq which increments by one each time a new message is published, a time stamp, a string containing frame_id, a float containing time, and a float containing configuration * The /demo_subscriber_topic subscribes to a message which contains a String data.
  4. Message packages were found by running rostopic info on each node. The /demo_publish_topic is of type ME495Pub while the /demo_subscriber_topic is of type std_msgs/String.
  5. The publisher /demo_publish_topic publishes data at around 50 Hz. This rate was determined by using the rostopic hz tool.
  6. The /demo_publish_topic data was was plotted using rqt_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.
  7. A message of type std_msg/String is published using the rostopic pub tool. 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
  1. The node ros_cl_demo also contains one service provider.
  2. The names of service providers can be found using rosservice list. The node contains a unique service /me495_math_server in addition to the usual logging servers.
  3. The service description can be found using rosservice info. The service is of type me495_hw1/ME495Srv. More information about this type can be found using the rossrv show tool. The me495_hw1/ME495Srv service type requests an unsigned 32 bit integer as an input and outputs an unsigned 8 bit integer.
  4. The service can be called using the rosservice call tool. This service returns the number of digits of the input argument.

Working with the turtlesim package

The purpose of the figure8 package is to interface with the existing turtlesim package in order to make the turtle follow a reference trajectory.

figure8_node.py

The node figure8_node.py serves two purposes:

  1. 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_absolute service provided by the turtlebot package.
  2. Then, it calls control_turtle which calculates the control for the turtle and publishes these values to turtle1/cmd_vel using geometry_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

Other package notes

  • figure8_node.py contains 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 to T = 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.

About

Turtle trajectory tracking

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages