-
Notifications
You must be signed in to change notification settings - Fork 6
Developer's Guide
Welcome to the Wiki! A more detailed explanation of how things work under the hood will be explained here, for future developers to have an easier transition. Scroll to the bottom for a list of potential to-do items and suggestions.
Updated: 14/7/2020
There are 4 scripts that are control the bulk of the experiment logic/flow, namely:
- postercombiner.py
- gui.py
- Experiment.py
- controller_joystick.py
Node:
curr_posters
Subscribing to:
-
poster- PoseStamped -
trigger_msgs- Int16 -
file_name- String
Publishing to:
-
poster_comb- PoseArray -
poster_comb_text- MarkerArray
Description:
This script mainly interfaces with Rviz to enable poster (reward zone) modification and visualization. It receives the file_name which is a csv file specified by the user in a drop down menu. The right csv file is then parsed and visualization info sent to Rviz with poster_comb and poster_comb_text.
It also receives new poster locations specified by the user in Rviz through the poster topic. Modifications will be made to the actual csv file specified by file_name, and updated visualization information sent through poster_comb and poster_comb_text.
The above behavior will continue until a locking mechanism get's toggled (so that users will not accidentally modify rewards during the actual experiment. The locking mechanism interfaces with the Experiment.py script, which publishes trigger_msgs. It stops updating when it receives any new messages from the topic, unless the message is 55, which indicates that the experiment has ended and reward modifications can resume.
Node:
gui_selection
Publishing to:
-
file_name- String
Description:
This script uses QT framework to create a graphical interface, allowing users to set experiment parameters. Sends postercombiner.py the current csv file to edit through file_name topic. On clicking the start button, parameters are saved to a eparams.pkl file, and the Experiment.py script gets called.
Node:
triggers
Subscribing to:
-
amcl_pose- PoseWithCovarianceStamped
Publishing to:
-
current_poster- PoseStamped -
trigger_msgs- Int16
Description:
This script mainly controls the actual experiment and trials. Experiment parameters are read in from eparams.pkl. Recording of data is also controlled here - rosbag with ros timing, csv with psychopy timing. It publishes a number to trigger_msgs to denote different stages of the experiment. The tens digit signify trial stage (cue onset, cue offset, end of trial, end of experiment), and the ones digit codes for reward ID.
On each new trial, the new selected poster location is sent to Rviz through current_poster for displaying purposes. A message is also sent through ./tcp-server to the iPad/iPhone to display the target poster. Trial timings are tracked using psychopy timers. The script listens to key-presses (p, r, t, y, n) for user interaction.
Node:
base_scan
Subscribing to:
-
base_scan- LaserScan -
joy- Joy -
trigger_msgs- Int16
Publishing to:
-
RosAria/cmd_vel- Twist
Description:
Maps secondary joystick input (joy) and controls whether it is allowed to actually move the platform. Speed is (see to-do) throttled based on distance to wall, determined by LIDAR base_scan. It also listens to trigger_msgs to lock the secondary joystick during the cue-onset period.
- flags in
controller_joystick.py->update_flag()andmove()may be slightly broken now (previously modified for ease of testing) - Improve AMCL localization (physical environment modification, physical platform modification, or AMCL parameter tweaking)
- Check that the parameters, loading and saving in
gui.pyare all working fine (as of last update, only the maze parameters page has been rigorously tested) - Set up hardware connection for Ripple (LPT) and Eyelink (ethernet)
- Insert script into existing code for Ripple (trigger recording and saving around
Experiment.py) - Insert script to allow for optional eyelink calibration stage, triggered on
Startbutton, to be run beforeExperiment.py - Experiment script now does not account for poster direction and platform direction. Both sets of information available, just that checking function isn't implemented. Success should only be triggered if platform is in a cone area in front of poster, and is pointed toward the poster.
- Reward definition stage hard-codes number of rewards to 6, in
postercombiner.py,to_storevariable [QOL improvement] - Now unable to create new csv files from
gui.py[QOL improvement] - Some paths still need to be fixed to be relative [QOL improvement]
- Catch improper experiment termination, killing rosbags etc properly [QOL improvement]