Robotics Class 2011/Assignment 1: Difference between revisions
From HacDC Wiki
mNo edit summary |
mNo edit summary |
||
Line 5: | Line 5: | ||
In order to start publishing the "sensorPacket" at home without a robot, you will need to check out the irobot_sensor_simulator ROS package, available from the HacDC ROS repository (several of you already installed it): | In order to start publishing the "sensorPacket" at home without a robot, you will need to check out the irobot_sensor_simulator ROS package, available from the HacDC ROS repository (several of you already installed it): | ||
cd to where you store your downloaded ROS packages | '''cd''' to where you store your downloaded ROS packages | ||
svn co http://hacdc-ros-pkg.googlecode.com/svn/trunk/irobot_sensor_simulator | '''svn co http://hacdc-ros-pkg.googlecode.com/svn/trunk/irobot_sensor_simulator''' | ||
rosmake robot_emotions | '''rosmake robot_emotions''' | ||
Once the make is done, you can start up the simulator by typing: | Once the make is done, you can start up the simulator by typing: | ||
rosrun irobot_sensor_simulator sensor_simulator.py | '''rosrun irobot_sensor_simulator sensor_simulator.py''' | ||
Note that this node will not produce any output. It will just sit there. If you do a "rostopic list" at this point, you will see a sensorPacket topic, and you can display it using "rostopic echo sensorPacket". | Note that this node will not produce any output. It will just sit there. If you do a "rostopic list" at this point, you will see a sensorPacket topic, and you can display it using "rostopic echo sensorPacket". | ||
Line 16: | Line 16: | ||
In order to start modifying the values to test your emotion generator, you will need to run the ROS dynamic_reconfigure "reconfigure_gui". This will provide the GUI interface illustrated in class that allows you to modify values in the sensorPacket. You can start the reconfigure GUI by typing: | In order to start modifying the values to test your emotion generator, you will need to run the ROS dynamic_reconfigure "reconfigure_gui". This will provide the GUI interface illustrated in class that allows you to modify values in the sensorPacket. You can start the reconfigure GUI by typing: | ||
rosrun dynamic_reconfigure reconfigure_gui | '''rosrun dynamic_reconfigure reconfigure_gui''' | ||
You will need to select irobot_sensor_simulator from the drop down box and you should then be presented with boxes and sliders that let you change the values of the sensor packet in real time. | You will need to select irobot_sensor_simulator from the drop down box and you should then be presented with boxes and sliders that let you change the values of the sensor packet in real time. | ||
Line 22: | Line 22: | ||
In order to obtain the definition of the robot_emotions/EmotionalState message, you will need to check out the robot_emotions ROS package from the HacDC ROS repository: | In order to obtain the definition of the robot_emotions/EmotionalState message, you will need to check out the robot_emotions ROS package from the HacDC ROS repository: | ||
cd to where you store your downloaded ROS packages | '''cd''' to where you store your downloaded ROS packages | ||
svn co http://hacdc-ros-pkg.googlecode.com/svn/trunk/robot_emotions | '''svn co http://hacdc-ros-pkg.googlecode.com/svn/trunk/robot_emotions''' | ||
rosmake robot_emotions | '''rosmake robot_emotions''' | ||
You can explore the structure of the two above message types by using rosmsg show in the following way: | You can explore the structure of the two above message types by using rosmsg show in the following way: | ||
rosmsg show irobot_create_2_1/SensorPacket | '''rosmsg show irobot_create_2_1/SensorPacket''' | ||
rosmsg show robot_emotions/EmotionalState | '''rosmsg show robot_emotions/EmotionalState''' | ||
Assignment Hint: | Assignment Hint: | ||
The robot_emotions ROS package is actually a complete (but very simple) solution to the homework. Feel free to investigate it if you need help. If you want to try running the emotion generator provided within the robot_emotions package, just type (after doing the rosmake robot_emotions above): | The robot_emotions ROS package is actually a complete (but very simple) solution to the homework. Feel free to investigate it if you need help. If you want to try running the emotion generator provided within the robot_emotions package, just type (after doing the rosmake robot_emotions above): | ||
rosrun rosrun robot_emotions emotion_generator.py | '''rosrun rosrun robot_emotions emotion_generator.py''' | ||
After typing this, a "rostopic list" command will show a new topic called robot_emotions, just as the assignment asked for. | After typing this, a "rostopic list" command will show a new topic called robot_emotions, just as the assignment asked for. |
Revision as of 20:11, 4 June 2011
Assignment 1 for the Robotics Class 2011
Write a ROS node that subscribes to the "sensorPacket" topic (a message of type irobot_create_2_1/SensorPacket), and uses values from within this packet to represent the emotional state of the robot. You will then publish the robot emotional state via publishing a message of type robot_emotions/EmotionalState with the topic name "robot_emotions".
In order to start publishing the "sensorPacket" at home without a robot, you will need to check out the irobot_sensor_simulator ROS package, available from the HacDC ROS repository (several of you already installed it):
cd to where you store your downloaded ROS packages svn co http://hacdc-ros-pkg.googlecode.com/svn/trunk/irobot_sensor_simulator rosmake robot_emotions
Once the make is done, you can start up the simulator by typing: rosrun irobot_sensor_simulator sensor_simulator.py
Note that this node will not produce any output. It will just sit there. If you do a "rostopic list" at this point, you will see a sensorPacket topic, and you can display it using "rostopic echo sensorPacket".
In order to start modifying the values to test your emotion generator, you will need to run the ROS dynamic_reconfigure "reconfigure_gui". This will provide the GUI interface illustrated in class that allows you to modify values in the sensorPacket. You can start the reconfigure GUI by typing:
rosrun dynamic_reconfigure reconfigure_gui
You will need to select irobot_sensor_simulator from the drop down box and you should then be presented with boxes and sliders that let you change the values of the sensor packet in real time.
In order to obtain the definition of the robot_emotions/EmotionalState message, you will need to check out the robot_emotions ROS package from the HacDC ROS repository:
cd to where you store your downloaded ROS packages svn co http://hacdc-ros-pkg.googlecode.com/svn/trunk/robot_emotions rosmake robot_emotions
You can explore the structure of the two above message types by using rosmsg show in the following way: rosmsg show irobot_create_2_1/SensorPacket rosmsg show robot_emotions/EmotionalState
Assignment Hint: The robot_emotions ROS package is actually a complete (but very simple) solution to the homework. Feel free to investigate it if you need help. If you want to try running the emotion generator provided within the robot_emotions package, just type (after doing the rosmake robot_emotions above):
rosrun rosrun robot_emotions emotion_generator.py
After typing this, a "rostopic list" command will show a new topic called robot_emotions, just as the assignment asked for.