From: Federica Di Lauro Date: Mon, 27 Jan 2020 16:39:06 +0000 (+0100) Subject: clean repo X-Git-Url: http://git.leonardobizzoni.com/?a=commitdiff_plain;h=9d6dffc9e26d8b3170ea483016480659942008ed;p=pioneer-stm32 clean repo --- diff --git a/.gitignore b/.gitignore index 15ec1e4..66b9ca5 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,5 @@ dkms.conf # Eclipse .metadata/ RemoteSystemsTempFiles/ +*/Debug +*/Release diff --git a/otto_controller/otto_controller_source Debug.cfg b/otto_controller/otto_controller_source Debug.cfg deleted file mode 100644 index 12d525f..0000000 --- a/otto_controller/otto_controller_source Debug.cfg +++ /dev/null @@ -1,40 +0,0 @@ -# This is an genericBoard board with a single STM32F767ZITx chip -# -# Generated by STM32CubeIDE -# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s) - -source [find interface/stlink.cfg] - -set WORKAREASIZE 0x8000 - -transport select "hla_swd" - -set CHIPNAME STM32F767ZITx -set BOARDNAME genericBoard - -# Enable debug when in low power modes -set ENABLE_LOW_POWER 1 - -# Stop Watchdog counters when halt -set STOP_WATCHDOG 1 - -# STlink Debug clock frequency -set CLOCK_FREQ 8000 - -# Reset configuration -# use hardware reset, connect under reset -# connect_assert_srst needed if low power mode application running (WFI...) -reset_config srst_only srst_nogate connect_assert_srst -set CONNECT_UNDER_RESET 1 -set CORE_RESET 0 - - - -# BCTM CPU variables - - - -source [find target/stm32f7x.cfg] - - - diff --git a/otto_controller/otto_controller_source Debug.launch b/otto_controller/otto_controller_source Debug.launch deleted file mode 100644 index 4430a2d..0000000 --- a/otto_controller/otto_controller_source Debug.launch +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/utils/catkin_ws/README.md b/utils/catkin_ws/README.md new file mode 100644 index 0000000..1dd7c9f --- /dev/null +++ b/utils/catkin_ws/README.md @@ -0,0 +1,11 @@ +### ROS workspace + +This workspace contains useful ros nodes to drive Otto and get the odometry. + +ROS nodes: + +*joy_to_cmd_vel: used to translate joy msgs to cmd_vel msgs +*cmd_vel_transmitter: used to send the velocities setpoints to the board through the serial adapter. + +ROS launches: +* joypad.launch: launches the necessary nodes to drive Otto with a joypad. Requires joy, joy_to_cmd_vel, cmd_vel_transmitter. \ No newline at end of file diff --git a/utils/catkin_ws/test.launch b/utils/catkin_ws/joypad.launch similarity index 63% rename from utils/catkin_ws/test.launch rename to utils/catkin_ws/joypad.launch index ed8edaf..69f8ec6 100644 --- a/utils/catkin_ws/test.launch +++ b/utils/catkin_ws/joypad.launch @@ -1,6 +1,5 @@ - - + diff --git a/utils/catkin_ws/src/joypad_bridge/scripts/cmd_vel_transmitter.py b/utils/catkin_ws/src/joypad_bridge/scripts/cmd_vel_transmitter.py new file mode 100755 index 0000000..ae2859c --- /dev/null +++ b/utils/catkin_ws/src/joypad_bridge/scripts/cmd_vel_transmitter.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +import rospy, serial, struct, time +from geometry_msgs.msg import Twist + +ser = serial.Serial( + port='/dev/ttyUSB0', + baudrate=115200, + parity=serial.PARITY_NONE, + stopbits=serial.STOPBITS_ONE, + bytesize=serial.EIGHTBITS, + rtscts=False) + +current_millis = 0 +last_millis = 0 + +def callback(data): + global current_millis + global last_millis + #da fixare + linear = -data.linear.x + angular = -data.angular.z + last_millis = current_millis + current_millis = int(round(time.time() * 1000)) + rospy.loginfo('I heard %f %f', linear, angular) + if (1): + msg_output = struct.pack('