Skip to content

Commit

Permalink
fixex issue#1
Browse files Browse the repository at this point in the history
  • Loading branch information
aarsht7 committed Jun 20, 2024
1 parent 0004ad0 commit 4d26909
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion launch/natnet_ros2.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ def node_fn(context,*args, **kwargs):
ld=[]
node = LifecycleNode(
package="natnet_ros2",
executable="natnet_ros2",
executable="natnet_ros2_node",
output="screen",
name=node_name.perform(context),
namespace=node_name.perform(context),
parameters=params,
#arguments=[
# "--ros-args",
Expand Down
11 changes: 7 additions & 4 deletions scripts/helper_node_r2.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

def kill_subp():
procs = str(subprocess.check_output(["ps","-a"])).split('\\n')
print(procs)
#print(procs)
for i in range(len(procs)-2):
if "bash <defunct>" in procs[i]:
pid = None
Expand All @@ -53,7 +53,10 @@ def kill_subp():
subprocess.check_call(["kill","-9",str(pid)])
except:
pass
subprocess.check_call(["pkill","_ros2_daemon"])
try:
subprocess.check_call(["pkill","_ros2_daemon"])
except:
pass

class WorkerThread(QThread):
finished_signal = pyqtSignal(int)
Expand Down Expand Up @@ -180,7 +183,7 @@ def start(self):
source /opt/ros/{dist}/setup.bash;
source {pwd}/install/setup.bash;
export ROS_DOMAIN_ID={id};
ros2 launch natnet_ros_cpp natnet_ros2.launch.py node_name:={name} serverIP:={sip} \
ros2 launch natnet_ros2 natnet_ros2.launch.py node_name:={name} serverIP:={sip} \
clientIP:={cip} serverType:={st} multicastAddress:={mca} \
serverCommandPort:={scp} serverDataPort:={sdp} global_frame:={gf} \
remove_latency:={rl} pub_rigid_body:={prb} pub_rigid_body_marker:={prbm} \
Expand All @@ -201,7 +204,7 @@ def stop(self):
command='''
source /opt/ros/{dist}/setup.bash;
export ROS_DOMAIN_ID={id};
ros2 lifecycle set /{name} shutdown
ros2 lifecycle set /{name}/{name} shutdown
'''.format(dist=self.ros_dist,id=self.id,name=self.name)
#stop_node_thread = WorkerThread(command)
#stop_node_thread.start()
Expand Down

0 comments on commit 4d26909

Please sign in to comment.