Conversation
1390815 to
bf1ab95
Compare
filtering/filter_balsaq.cc
Outdated
| // const auto time_of_validity = to_time_point(imu_msg.timestamp); | ||
| // const jcc::Vec3 gyro_radps(imu_msg.gyro_radps_x, imu_msg.gyro_radps_y, imu_msg.gyro_radps_z); | ||
| // estimation::jet_filter::GyroMeasurement gyro_meas; | ||
| // gyro_meas.observed_w = gyro_radps; |
filtering/filter_viz_balsaq.cc
Outdated
| sensor_geo_->add_ellipsoid({fit.ellipse, jcc::Vec4(0.4, 0.6, 0.4, 0.7), 2.0}); | ||
| sensor_geo_->flush(); | ||
| }; | ||
| // std::cout << "Optimizing" << std::endl; |
filtering/filter_demo.cc
Outdated
|
|
||
| // speeds_plot.subplots["opt_est_dot_x"].points.push_back({dt, x.x.R_world_from_body.log().x()}); | ||
| // speeds_plot.subplots["opt_est_dot_y"].points.push_back({dt, x.x.R_world_from_body.log().y()}); | ||
| // speeds_plot.subplots["opt_est_dot_z"].points.push_back({dt, x.x.R_world_from_body.log().z()}); |
There was a problem hiding this comment.
remove comments before landing
9438487 to
7b2d67c
Compare
IJDykeman
left a comment
There was a problem hiding this comment.
will review the rest later
| note: these cal values were copied from camera 0 | ||
| camera_matrix: [499.7749869454186, 0, 309.3792706235992, | ||
| 0, 496.9300965132637, 241.6934416030273, | ||
| 0, 496.9300965132637, 241.6934416030273, |
control/controller_balsaq.cc
Outdated
|
|
||
| const jcc::Vec3 w_jet_frame = pose.world_from_jet.inverse() * pose.w_world_frame; | ||
|
|
||
| const MatNd<3, 3> Kp = cfg.kp.asDiagonal(); |
There was a problem hiding this comment.
3.6 roentgen/hr on this abbreviation
control/controller_balsaq.hh
Outdated
| namespace control { | ||
|
|
||
| struct GainConfig { | ||
| jcc::Vec3 kp; |
| node["camera_matrix"].push_back(K.at<double>(i, j)); | ||
| } | ||
| } | ||
| node["resolution"].push_back(cols); |
There was a problem hiding this comment.
low nobility factor maintaining this variable as state while iterating over images.
There was a problem hiding this comment.
Wait -- what do you mean?
There was a problem hiding this comment.
referring to the fact that we set cols = image->image.cols; above as a way of getting the resolution for all the images. Could improve by either giving a more specific name so that once doesn't have to scroll way up to see what it refers to. Or by breaking all the image reading into a separate function that returns a struct that keeps all the data you get from reading images together.
| jcc::Warning() << "Calibrating camera, this might take a while..." << std::endl; | ||
| int flag = 0; | ||
| const auto t0 = jcc::now(); | ||
| cv::calibrateCamera(object_points, image_points, cv::Size(480, 270), K, D, rvecs, tvecs, flag); |
There was a problem hiding this comment.
Pull out resolution constant
filtering/calibrate_jet.cc
Outdated
| } | ||
|
|
||
| jcc::Optional<ejf::FiducialMeasurement> find_nearest_fiducial( | ||
| const std::vector<estimation::TimedMeasurement<ejf::FiducialMeasurement>> fiducial_meas, |
filtering/calibrate_jet.cc
Outdated
| std::cout << node << std::endl; | ||
| } | ||
|
|
||
| jcc::Optional<ejf::FiducialMeasurement> find_nearest_fiducial( |
There was a problem hiding this comment.
call it eg find nearest in time
filtering/calibrate_jet.cc
Outdated
| return SE3(world_from_camera, jcc::Vec3::Zero()); | ||
| } | ||
|
|
||
| ejf::Parameters compute_parameters( |
There was a problem hiding this comment.
better name than compute_parameters
c380b4c to
cb0c985
Compare
|
|
||
| double gear_ratio_servo_from_vane = 5.33; | ||
| // double gear_ratio_servo_from_vane = 5.33; | ||
| double gear_ratio_servo_from_vane = 1.0; |
There was a problem hiding this comment.
This doesn't appear to be the actual ratio. Are we sure we should land this?
| void ServoBq::init(const Config& config) { | ||
| subscriber = make_subscriber("servo_command_channel"); | ||
| subscriber_ = make_subscriber("servo_command_channel"); | ||
| publisher_ = make_publisher("servo_pwm_commands_channel"); |
There was a problem hiding this comment.
I might indicate in the subscriber and publisher names the channels they are on.
| void ServoDriver::set_percentage(float unchecked_percentage) { | ||
| if (unchecked_percentage > 100 || unchecked_percentage < 0) { | ||
| void ServoDriver::set_percentage(const double unchecked_percentage, const int max_pwm_count, const int min_pwm_count) { | ||
| if (unchecked_percentage > 1.0 || unchecked_percentage < 0.0) { |
There was a problem hiding this comment.
It looks like you are calling this "percentage" but it is expected to be in [0,1] not [0,100]. Rename?
| // Set up the viewer | ||
| // | ||
|
|
||
| setup(); |
| constexpr int DECIMATION = 25; | ||
|
|
||
| int i = 0; | ||
| while (true) { |
There was a problem hiding this comment.
might break this into a function that returns in the data you need from the images.
| node["camera_matrix"].push_back(K.at<double>(i, j)); | ||
| } | ||
| } | ||
| node["resolution"].push_back(cols); |
There was a problem hiding this comment.
referring to the fact that we set cols = image->image.cols; above as a way of getting the resolution for all the images. Could improve by either giving a more specific name so that once doesn't have to scroll way up to see what it refers to. Or by breaking all the image reading into a separate function that returns a struct that keeps all the data you get from reading images together.
| jf.measure_fiducial(fiducial_meas.measurement, fiducial_meas.timestamp); | ||
| } | ||
|
|
||
| constexpr bool USE_ACCELEROMETER = false; |
There was a problem hiding this comment.
Seems too important to be floating down here.
| collected_fiducial_meas.push_back({fiducial_measurement, t}); | ||
| } | ||
|
|
||
| // TODO: NEXT, FILL THIS IN |
|
|
||
| const std::vector<std::string> imu_channels = one_imu_present ? single_imu : both_imu; | ||
|
|
||
| // const bool two_imus = !one_imu_present; |
| gonogo().nogo("Starting up"); | ||
| std::cout << "Starting up" << std::endl; | ||
|
|
||
| std::cout << "Subscribing Fiducial..." << std::endl; |
|
|
||
| pose_geo_->add_axes({pose.world_from_jet, 0.55, 3.0, true}); | ||
|
|
||
| // const jcc::Vec3 jet_origin(1.0, 0.0, 0.0); |
| pose_geo_->flip(); | ||
|
|
||
| const SE3 body_from_model = jcc::exp_z(-M_PI * 0.5); | ||
| // const SE3 body_from_model = jcc::exp_z(0.0); |
|
|
||
| // | ||
| // Pose has the following contract: | ||
| // - Z points in the gravity direction |
There was a problem hiding this comment.
Might disambiguate by writing +Z here since it looks like -Z by accident.
| std::cerr << channel_name_ | ||
| << ": Not connected. Skipping read. Reason: " << (connecting_ ? "Connecting" : "Not connected") | ||
| << std::endl; | ||
| // std::cerr << channel_name_ |
There was a problem hiding this comment.
Remove this and the one above
No description provided.