From 3b8cb60d0611b34779521ece094bddc2c669f909 Mon Sep 17 00:00:00 2001 From: Maximilian Stiefel Date: Sun, 21 Feb 2021 17:43:23 +0100 Subject: [PATCH] Added scripts for motioneye --- drivers/a4988.cpp | 2 -- hal/stepper.cpp | 1 - motioneye/down | 7 +++++++ motioneye/up | 7 +++++++ settings.json | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) create mode 100755 motioneye/down create mode 100755 motioneye/up diff --git a/drivers/a4988.cpp b/drivers/a4988.cpp index 2061c1b..9e4fc53 100644 --- a/drivers/a4988.cpp +++ b/drivers/a4988.cpp @@ -22,7 +22,6 @@ namespace simon { } while(m_alive) { - std::cout << "In thread" << std::endl; if (!m_queue.empty()) { auto cmd = m_queue.front(); // Distinguish between different tytpes of commands and derive type @@ -33,7 +32,6 @@ namespace simon { } gpioHardwarePWM(m_ptr_set->gpio_step, m_pwm_freq, PI_HW_PWM_RANGE/2); gpioWrite(m_ptr_set->gpio_dir, move->dir); - std::cout << move->period_us << " - " << move->steps << std::endl; auto t_sleep = move->period_us*move->steps; std::this_thread::sleep_for(std::chrono::microseconds(t_sleep)); gpioHardwarePWM(m_ptr_set->gpio_step, m_pwm_freq, 0); diff --git a/hal/stepper.cpp b/hal/stepper.cpp index 15ccda6..f39042e 100644 --- a/hal/stepper.cpp +++ b/hal/stepper.cpp @@ -80,7 +80,6 @@ namespace simon { * static_cast(m_ptr_a4988->get_microsteps()); auto steps = static_cast((std::abs(degrees)/360.0f) * steps_360); bool direction = (degrees < 0) ? !m_stepper.clockwise : m_stepper.clockwise; - std::cout << "dir >" << direction << std::endl; m_ptr_a4988->post_move(steps, direction, 100); return steps; } diff --git a/motioneye/down b/motioneye/down new file mode 100755 index 0000000..75fc9b7 --- /dev/null +++ b/motioneye/down @@ -0,0 +1,7 @@ +#!/bin/bash +SAMCAM_HOME=/home/pi/camera_steering_sw +SETTINGS_FILE=$SAMCAM_HOME/settings.json +ANGLE=-10 +AXIS=elevation +export PATH=$SAMCAM_HOME/bin:$PATH +SaMcam --axis $AXIS --settings $SETTINGS_FILE --rotate $ANGLE diff --git a/motioneye/up b/motioneye/up new file mode 100755 index 0000000..c274dca --- /dev/null +++ b/motioneye/up @@ -0,0 +1,7 @@ +#!/bin/bash +SAMCAM_HOME=/home/pi/camera_steering_sw +SETTINGS_FILE=$SAMCAM_HOME/settings.json +ANGLE=10 +AXIS=elevation +export PATH=$SAMCAM_HOME/bin:$PATH +SaMcam --axis $AXIS --settings $SETTINGS_FILE --rotate $ANGLE diff --git a/settings.json b/settings.json index 49e6bb8..946d01c 100644 --- a/settings.json +++ b/settings.json @@ -4,7 +4,7 @@ "stepper": { "gear_reduction": 64.0, "steps_per_revolution": 32, - "clockwise" : true + "clockwise" : false }, "a4988": { "microsteps": 16,