The purpose of this repository is to fullfill the requirements of the ME 477 ROS mini-course final as listed here
These packages have been designed for use on systems with the following:
- ROS Melodic Morenia
- Ubuntu 18.04.4 LTS (Bionic Beaver).
In order to make these packages accessible within the ROS installation, the following steps must be completed:
- Create a ROS workspace with a
src
directory. - Clone this repository to the
src
directory.
git clone https://github.com/Hegemon98/ME477.git
- In the workspace, make.
catkin_make
- Source the workspace.
source devel/setup.bash
The my_topics package contains four nodes:
- message_publisher.py: this node publishes a message with an imaginary and a real value
- message_subscriber.py: this node subscribes to message_publisher.py and displays the recieved values in the terminal
- topic_publisher.py: this node publishes a topic called counter which increments upward after every publish
- topic_subscriber.py: this node subscribes to topic_publisher.py and dispays the recieved values in the terminal
These nodes are usefull in demonstrating basic topic and message node functionality and communication and can be used as starting points for more advanced use cases.
roslaunch my_topics topics.launch
Using the above launch command, the four nodes within this package will launch and begin printing to the terminal. Expected output should resemble the following:
1
Real: 0.021548465
Imaginary: 0.984262465
For individual usage of these nodes the following command format may be used with roscore running in another terminal.
rosrun <package name> <node name>
Example:
rosrun my_topics topic_publisher.py
It should be noted that the subscriber files will not be functional without also having their associated publisher file also running.
The my_services package contains two nodes:
- service_client.py: this node accepts strings of characters from the user via the command line, counts the number of words, and outputs the result.
- service_server.py: this node contains a service called word_count which is used by service_client.py to count the number of input words.
These nodes are usefull in demonstrating basic service node functionality and communication and can be used as starting points for more advanced use cases.
roslaunch my_services services.launch input:='<insert text here>'
Using the above launch command, the two nodes within this package will launch and begin printing to the terminal. Expected output should resemble the following:
user input--> has 2 words
For individual usage of these nodes the following command format may be used with roscore running in another terminal.
rosrun <package name> <node name> <user input>
Example:
rosrun my_services service_client.py hello world
It should be noted that the user input argument should only be used when calling the client. Additionally, strings containing a double underscore __ will be filtered out and therefore should not be entered into this node. This is done to filter out extra command line entries that occur when using this node within a launch file.
The my_actions package contains two nodes:
- fancy_action_client.py: this node communicates with fancy_action_server.py using the variables established in Timer.action located in my_actions/action. It also outputs recieved values to the terminal.
- fancy_action_server.py: this node returns the time elapsed and remaining time based on the goal.time_to_wait variable field within fancy_action_client.py.
These nodes are usefull in demonstrating uses of .action file functionality and can be used as a starting point for more advanced use cases.
roslaunch my_actions fancy_action.launch
Using the above launch command, the two nodes within this package will launch and begin printing to the terminal. Expected output should resemble the following:
[Feedback] Time elapsed: 0.000023
[Feedback] Time remaining: 4.999977
The goal.time_to_wait variable field within fancy_action_client.py may be edited in order to increase the amount of time available for execution of these nodes.