ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

EDJ14's profile - activity

2020-01-07 02:22:42 -0500 received badge  Famous Question (source)
2019-12-05 15:42:52 -0500 received badge  Notable Question (source)
2019-12-05 15:42:52 -0500 received badge  Famous Question (source)
2018-09-24 17:09:25 -0500 commented question Accel calibration issues with BN055 IMU

@babazaroni did you ever find a maintained IMU package?

2018-09-24 02:34:57 -0500 commented question Publishing rate decreases when multiple nodes are publishing

Sorry, how do you edit usb latency?

2018-09-24 01:01:36 -0500 commented question Publishing rate decreases when multiple nodes are publishing

they're connected via UART

2018-09-22 23:17:25 -0500 received badge  Notable Question (source)
2018-09-22 13:51:04 -0500 received badge  Popular Question (source)
2018-09-21 20:20:16 -0500 asked a question Publishing rate decreases when multiple nodes are publishing

Publishing rate decreases when multiple nodes are publishing I have 4 nodes running on a Raspberry Pi that collect data

2018-09-17 11:16:33 -0500 received badge  Popular Question (source)
2018-09-13 17:57:45 -0500 received badge  Supporter (source)
2018-09-13 17:57:06 -0500 marked best answer Cleanly kill rosbag with python script

I am running several ROS nodes (kinetic) on Raspbian, including a rosbag node that records all published topics. The script below is activated by pressing a physical button and is meant to ensure that the rosbag is killed cleanly (getting rid of the .bag.active state) before shutting the system off. When run manually from the terminal, the script executes without errors and cleanly kills the rosbag. But when the button is used to activate the script, the script is successfully called but stops at the subprocess.check_call(['rosnode', 'kill', '-a',]) line, preventing the rosbag from killing cleanly and preventing the system from shutting down. I'm wondering why the script fails to execute the ROS-specific lines when executed using the button?

Thanks

#!/usr/bin/env python

import RPi.GPIO as GPIO
import subprocess

GPIO.setmode(GPIO.BCM)

# This should turn on the LED
GPIO.setup(12, GPIO.OUT)
GPIO.output(12, GPIO.HIGH)

GPIO.setup(16, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.wait_for_edge(16, GPIO.FALLING)

subprocess.check_call(['rosnode', 'kill', '-a']) #cleanly kill the rosbag
# -h stands for --power-off
subprocess.call(['shutdown', '-h', 'now'], shell=False)
2018-09-13 17:57:06 -0500 received badge  Scholar (source)
2018-09-11 17:18:25 -0500 commented question Cleanly kill rosbag with python script

That was it! Thanks

2018-09-10 19:13:27 -0500 asked a question Cleanly kill rosbag with python script

Cleanly kill rosbag with python script I am running several ROS nodes (kinetic) on Raspbian, including a rosbag node tha