Skip to content

Commit fb30b79

Browse files
authored
Merge pull request #13 from SuperJappie08/ros2-dev
Intial ROS2 Work
2 parents f7651d7 + a1815e0 commit fb30b79

7 files changed

Lines changed: 619 additions & 150 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/__pycache__
2+
3+
COLCON_IGNORE
4+
.colcon_root

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2024, Martin Klomp, MIRTE-team
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
3. Neither the name of the copyright holder nor the names of its
16+
contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-1.88 KB
Binary file not shown.
-7.05 KB
Binary file not shown.

mirte_robot/linetrace.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import multiprocessing
1010
from websocket_server import WebsocketServer
1111

12-
# Already load rospy (whicht takes long) and robot, so mirte.py does not need to do this anymore
13-
import rospy
12+
# Already load rclpy (whicht takes long) and robot, so mirte.py does not need to do this anymore
13+
import rclpy
1414
from mirte_robot import robot
1515

1616
# Global shared memory objects (TODO: check if we need shared memory, why is server working?)
@@ -22,9 +22,9 @@
2222
# 1) the code finishes
2323
# 2) the user stopped the process
2424
# 3) the websocket connection is closed
25-
def stop_mirte(terminate = True):
25+
def stop_mirte():
2626
global running
27-
if terminate:
27+
if running.value:
2828
process.terminate()
2929
running.value = False
3030

@@ -68,8 +68,8 @@ def traceit(frame, event, arg):
6868

6969
# Sending the linetrace 0 to the client
7070
server.send_message_to_all("0")
71-
72-
stop_mirte(False)
71+
running.value = False
72+
stop_mirte()
7373

7474
process = multiprocessing.Process(target = load_mirte_module, args=(stepper, do_step))
7575

0 commit comments

Comments
 (0)