Skip to content

Stm #5

Open
wants to merge 55 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
6b38121
Create .gitignore
MisterMap Nov 4, 2018
f5bbce3
create stm_node
kshpv Nov 19, 2018
8d16dc2
minor improvements
kshpv Nov 21, 2018
54a249d
some improvements
kshpv Dec 11, 2018
74ef2cc
trash was removed
kshpv Dec 19, 2018
36d79db
...
kshpv Dec 19, 2018
b9a413d
Merge branch 'master' of https://github.com/SkoltechRobotics/ros-euro…
kshpv Dec 19, 2018
59139b8
Merge branch 'master' into stm
kshpv Dec 19, 2018
709812b
add new commands to protocol
kshpv Dec 19, 2018
2812d2e
new architecture. add odometry, manipulator files. add launch file
kshpv Jan 25, 2019
277836d
add jupyter files. minor changes
kshpv Jan 28, 2019
bbc00bf
minor changes
nickzherdev Jan 28, 2019
f066dfd
changes after testing
nickzherdev Jan 29, 2019
c693920
minor changes
kshpv Feb 6, 2019
b0400c1
add response publisher
kshpv Feb 6, 2019
4210dab
minor changes
kshpv Feb 6, 2019
e74944e
minor changes
kshpv Feb 6, 2019
0ac66b8
add resposne for manipulator
kshpv Feb 6, 2019
91a946e
add new commands. add config yaml to launch file
nickzherdev Feb 6, 2019
7b74276
add rosparam to launch file
kshpv Feb 6, 2019
50b22e4
add working manipulator
nickzherdev Feb 6, 2019
66de0fa
add working manipulator
kshpv Feb 10, 2019
36b078a
Merge branch 'stm' of https://github.com/SkoltechRobotics/ros-eurobot…
kshpv Feb 10, 2019
247eb76
minor changes
kshpv Feb 10, 2019
be283c2
add new commands
kshpv Feb 20, 2019
6a7e8d4
fix bugs, add hex cmd format
kshpv Feb 20, 2019
b93a745
add calibrate for big robot
kshpv Feb 20, 2019
165e50a
add calibrate for big robot
kshpv Feb 20, 2019
7a91fe7
fix bugs
nickzherdev Feb 20, 2019
2861899
fix bugs
kshpv Feb 20, 2019
bb9c2fe
manipulator fix bugs
kshpv Feb 20, 2019
ccd50bd
Merge branch 'stm' of https://github.com/SkoltechRobotics/ros-eurobot…
nickzherdev Feb 20, 2019
f2bc804
Merge branch 'stm' of https://github.com/SkoltechRobotics/ros-eurobot…
nickzherdev Feb 20, 2019
db42b47
manipulator fix bugs
kshpv Feb 20, 2019
6a7e976
Merge branch 'stm' of https://github.com/SkoltechRobotics/ros-eurobot…
kshpv Feb 20, 2019
f304e3e
Merge branch 'stm' of https://github.com/SkoltechRobotics/ros-eurobot…
nickzherdev Feb 20, 2019
835e5e3
add collect puck for big robot
kshpv Feb 20, 2019
12b1133
Merge branch 'stm' of https://github.com/SkoltechRobotics/ros-eurobot…
nickzherdev Feb 20, 2019
78715ef
add releaser
kshpv Feb 20, 2019
37b5663
after big robot tests
nickzherdev Feb 21, 2019
f082676
Merge branch 'stm' of https://github.com/SkoltechRobotics/ros-eurobot…
nickzherdev Feb 21, 2019
a5a725b
add tests
kshpv Feb 21, 2019
855d889
add commands for small
kshpv Feb 21, 2019
741db6a
add commands for small robot
kshpv Feb 21, 2019
b1910c4
Merge branch 'stm' of https://github.com/SkoltechRobotics/ros-eurobot…
kshpv Feb 21, 2019
a63a01c
Merge branch 'stm' of https://github.com/SkoltechRobotics/ros-eurobot…
kshpv Feb 21, 2019
ff3d30e
Merge branch 'stm' of https://github.com/SkoltechRobotics/ros-eurobot…
kshpv Feb 21, 2019
53baa36
add normal tests + fix bugs
kshpv Feb 21, 2019
be586ee
add tests
kshpv Feb 25, 2019
8c4c317
fixed manipulator
kshpv Feb 27, 2019
eadcb5d
fix manipulator
kshpv Feb 28, 2019
4706d3d
some fixes
kshpv Mar 5, 2019
ddf8d15
Merge branch 'stm' of https://github.com/SkoltechRobotics/ros-eurobot…
kshpv Mar 17, 2019
064cdc9
add new commands
kshpv Mar 17, 2019
1def553
fix spaces
kshpv Mar 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pyc
*.idea
*.swp
41 changes: 0 additions & 41 deletions camera_test.py

This file was deleted.

674 changes: 0 additions & 674 deletions eurobot_camera/LICENSE

This file was deleted.

16 changes: 0 additions & 16 deletions eurobot_camera/launch/undistrort.launch

This file was deleted.

65 changes: 0 additions & 65 deletions eurobot_camera/scripts/calibration.py

This file was deleted.

69 changes: 0 additions & 69 deletions eurobot_camera/scripts/undistort.py

This file was deleted.

10 changes: 5 additions & 5 deletions eurobot_camera/CMakeLists.txt → eurobot_stm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.3)
project(eurobot_camera)
project(eurobot_stm)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
Expand Down Expand Up @@ -104,7 +104,7 @@ find_package(catkin REQUIRED COMPONENTS
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES eurobot_camera
# LIBRARIES eurobot_stm
# CATKIN_DEPENDS roscpp rospy std_msgs
# DEPENDS system_lib
)
Expand All @@ -122,7 +122,7 @@ include_directories(

## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/eurobot_camera.cpp
# src/${PROJECT_NAME}/eurobot_stm.cpp
# )

## Add cmake target dependencies of the library
Expand All @@ -133,7 +133,7 @@ include_directories(
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/eurobot_camera_node.cpp)
# add_executable(${PROJECT_NAME}_node src/eurobot_stm_node.cpp)

## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
Expand Down Expand Up @@ -190,7 +190,7 @@ include_directories(
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_eurobot_camera.cpp)
# catkin_add_gtest(${PROJECT_NAME}-test test/test_eurobot_stm.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
Expand Down
1 change: 1 addition & 0 deletions eurobot_stm/configs/stm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ODOM_RATE: 40
9 changes: 9 additions & 0 deletions eurobot_stm/launch/STM_node.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<launch>
<rosparam file="$(find eurobot_stm)/configs/stm.yaml" command="load" ns="secondary_robot"/>
<group ns = "secondary_robot">
<node name="stm_node" pkg="eurobot_stm" type="STM.py" output="screen">
</node>
</group>
</launch>

6 changes: 3 additions & 3 deletions eurobot_camera/package.xml → eurobot_stm/package.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<package format="2">
<name>eurobot_camera</name>
<name>eurobot_stm</name>
<version>0.0.0</version>
<description>The eurobot_camera package</description>
<description>The eurobot_stm package</description>

<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
Expand All @@ -19,7 +19,7 @@
<!-- Url tags are optional, but multiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/eurobot_camera</url> -->
<!-- <url type="website">http://wiki.ros.org/eurobot_stm</url> -->


<!-- Author tags are optional, multiple are allowed, one per tag -->
Expand Down
50 changes: 50 additions & 0 deletions eurobot_stm/scripts/STM.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env python
import rospy
from std_msgs.msg import String

import itertools

from STM_protocol import STMprotocol
from odometry import Odometry
from manipulator import Manipulator

ODOM_RATE = rospy.get_param("ODOM_RATE")

class STM():
def __init__(self, serial_port, baudrate=115200):
rospy.init_node('stm_node', anonymous=True)
rospy.Subscriber("stm_command", String, self.stm_command_callback)
self.response = rospy.Publisher("stm_response", String, queue_size=50)

self.stm_protocol = STMprotocol(serial_port, baudrate)
self.odometry = Odometry(self.stm_protocol, ODOM_RATE)


def stm_command_callback(self, data):
id, cmd, args = self.parse_data(data)
successfully, values = self.stm_protocol.send(cmd, args)
st = "".join(values)
response = str(id) + " " + st
print ("RESPONSE=", values)
self.response.publish(response)

def parse_data(self, data):
data_splitted = data.data.split()
print (data_splitted)
id = data_splitted[0]
try:
cmd = int(data_splitted[1])
except ValueError as e:
cmd = int(data_splitted[1], 16)
args_dict = {'c': str, 'B': int, 'f': float}
args = [args_dict[t](s) for t, s in itertools.izip(self.stm_protocol.pack_format[cmd][1:], data_splitted[2:])]
return id, cmd, args

if __name__ == '__main__':


#TODO::search for ports

serial_port = "/dev/ttyUSB0"
stm = STM(serial_port)
rospy.spin()
Loading