...
This commit is contained in:
@@ -108,19 +108,29 @@ AsibFM700Hardware::error_t AsibFM700Hardware::getPos(AsibFM700Hardware::axes_pos
|
||||
auto err = static_cast<AsibFM700HardwareErrorCode>(Mount.getMountData(&data));
|
||||
|
||||
if (err == AsibFM700HardwareErrorCode::ERROR_OK) {
|
||||
// time point from sidservo library is 'struct timeval', i.e., seconds and
|
||||
// microseconds ellapsed from UNIX time epoch
|
||||
// time point from sidservo library is 'double' number represented UNIXTIME with
|
||||
// microseconds/nanoseconds precision (must be equal for encXposition and encYposition)
|
||||
|
||||
using secs_t = std::chrono::duration<double>;
|
||||
secs_t secs = secs_t{1.0 * data.encposition.msrtime.tv_sec + 1.0E-6 * data.encposition.msrtime.tv_usec};
|
||||
|
||||
secs_t secs = secs_t{data.encXposition.t};
|
||||
pos.time_point = time_point_t{std::chrono::duration_cast<time_point_t::duration>(secs)};
|
||||
|
||||
// according to hardware configuration (encoders pins (Eddy said)) X is DEC-axis and Y is HA-axis
|
||||
pos.x = data.encposition.Y;
|
||||
pos.y = data.encposition.X;
|
||||
// according to "SiTech protocol notes" X is DEC-axis and Y is HA-axis
|
||||
pos.x = data.encYposition.val;
|
||||
pos.y = data.encXposition.val;
|
||||
|
||||
// ERROR: how can I get rates?!!!!!!!!!!
|
||||
pos.xrate = data.encYspeed.val;
|
||||
pos.yrate = data.encXspeed.val;
|
||||
|
||||
// mount state
|
||||
|
||||
// are both motors stopped?
|
||||
bool stop_motors = (data.extradata.ExtraBits & XMOTOR_STOP_BIT) && (data.extradata.ExtraBits & YMOTOR_STOP_BIT);
|
||||
if (stop_motors) {
|
||||
pos.state = hw_state_t::HW_STATE_STOP;
|
||||
return AsibFM700HardwareErrorCode::ERROR_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
|
||||
Reference in New Issue
Block a user