BCLab-UNM / SC2

Swarmathon Team Code for the NASA Space Challenge 2 Competition
MIT License
2 stars 0 forks source link

Create log analzier class in Scoot.py and have an instance for scoot instances #86

Open Carter90 opened 4 years ago

Carter90 commented 4 years ago

Yeah lets create a class in Scoot.py have an instance in scoot that looks at the logs being written on the /rosout topic

So it would store some value that would indicate the error state it last saw (recently), easy with a call back.

Like knowing the float from "System processing previous call, there are still 27.797383 seconds left" could save significant time as we can sleep for that exact amount and if we miss the message(somehow) we can wait the maximum time which is what we are already doing.

Also if our coordinates are wrong we can move abit or something.

And if neither work we know we might actually have a real exception

Data:

---
header: 
  seq: 5
  stamp: 
    secs: 8
    nsecs: 948000000
  frame_id: ''
level: 2
name: "/gazebo"
msg: "No volatile within maximum x,y error of 2.000000 meters at [0.000000, 0.000000],\
  \ no points awarded"
file: "/ros_workspace/src/srcp2_gazebo/src/qual_rounds/qual_1_scoring.cc"
function: "QualOneScoring::volatileDetectionServiceCallback"
line: 200
topics: [/rosout, /clock, /gazebo/link_states, /gazebo/model_states, /gazebo/parameter_descriptions,
  /gazebo/parameter_updates, /qual_1_score, /scout_1/imu, /scout_1/laser/scan, /scout_1/camera/left/parameter_descriptions,
  /scout_1/camera/left/parameter_updates, /scout_1/camera/right/parameter_descriptions,
  /scout_1/camera/right/parameter_updates, /scout_1/volatile_sensor, /scout_1/camera/left/image_raw/compressed,
  /scout_1/camera/right/image_raw/compressed, /scout_1/camera/right/image_raw/compressed/parameter_descriptions,
  /scout_1/camera/right/image_raw/compressed/parameter_updates, /scout_1/camera/left/image_raw/compressed/parameter_descriptions,
  /scout_1/camera/left/image_raw/compressed/parameter_updates, /scout_1/camera/right/image_raw,
  /scout_1/camera/left/image_raw, /scout_1/camera/right/camera_info, /scout_1/camera/left/camera_info,
  /tf, /scout_1/joint_states, /scout_1/fr_steering_arm_controller/pid/parameter_descriptions,
  /scout_1/fr_steering_arm_controller/pid/parameter_updates, /scout_1/fr_steering_arm_controller/state,
  /scout_1/fl_steering_arm_controller/pid/parameter_descriptions, /scout_1/fl_steering_arm_controller/pid/parameter_updates,
  /scout_1/fl_steering_arm_controller/state, /scout_1/br_steering_arm_controller/pid/parameter_descriptions,
  /scout_1/br_steering_arm_controller/pid/parameter_updates, /scout_1/br_steering_arm_controller/state,
  /scout_1/bl_steering_arm_controller/pid/parameter_descriptions, /scout_1/bl_steering_arm_controller/pid/parameter_updates,
  /scout_1/bl_steering_arm_controller/state, /scout_1/sensor_controller/pid/parameter_descriptions,
  /scout_1/sensor_controller/pid/parameter_updates, /scout_1/sensor_controller/state]
---
header: 
  seq: 6
  stamp: 
    secs: 11
    nsecs:  97000000
  frame_id: ''
level: 2
name: "/gazebo"
msg: "System processing previous call, there are still 27.797383  seconds left"
file: "/ros_workspace/src/srcp2_gazebo/src/qual_rounds/qual_1_scoring.cc"
function: "QualOneScoring::serviceTimeoutOk"
line: 298
topics: [/rosout, /clock, /gazebo/link_states, /gazebo/model_states, /gazebo/parameter_descriptions,
  /gazebo/parameter_updates, /qual_1_score, /scout_1/imu, /scout_1/laser/scan, /scout_1/camera/left/parameter_descriptions,
  /scout_1/camera/left/parameter_updates, /scout_1/camera/right/parameter_descriptions,
  /scout_1/camera/right/parameter_updates, /scout_1/volatile_sensor, /scout_1/camera/left/image_raw/compressed,
  /scout_1/camera/right/image_raw/compressed, /scout_1/camera/right/image_raw/compressed/parameter_descriptions,
  /scout_1/camera/right/image_raw/compressed/parameter_updates, /scout_1/camera/left/image_raw/compressed/parameter_descriptions,
  /scout_1/camera/left/image_raw/compressed/parameter_updates, /scout_1/camera/right/image_raw,
  /scout_1/camera/left/image_raw, /scout_1/camera/right/camera_info, /scout_1/camera/left/camera_info,
  /tf, /scout_1/joint_states, /scout_1/fr_steering_arm_controller/pid/parameter_descriptions,
  /scout_1/fr_steering_arm_controller/pid/parameter_updates, /scout_1/fr_steering_arm_controller/state,
  /scout_1/fl_steering_arm_controller/pid/parameter_descriptions, /scout_1/fl_steering_arm_controller/pid/parameter_updates,
  /scout_1/fl_steering_arm_controller/state, /scout_1/br_steering_arm_controller/pid/parameter_descriptions,
  /scout_1/br_steering_arm_controller/pid/parameter_updates, /scout_1/br_steering_arm_controller/state,
  /scout_1/bl_steering_arm_controller/pid/parameter_descriptions, /scout_1/bl_steering_arm_controller/pid/parameter_updates,
  /scout_1/bl_steering_arm_controller/state, /scout_1/sensor_controller/pid/parameter_descriptions,
  /scout_1/sensor_controller/pid/parameter_updates, /scout_1/sensor_controller/state]