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

ceverett's profile - activity

2021-06-03 12:26:11 -0500 received badge  Good Question (source)
2018-11-20 21:59:57 -0500 received badge  Necromancer (source)
2017-11-14 13:36:56 -0500 received badge  Nice Question (source)
2017-11-14 13:36:54 -0500 received badge  Guru (source)
2017-11-14 13:36:54 -0500 received badge  Great Answer (source)
2017-09-06 06:22:02 -0500 received badge  Nice Question (source)
2017-07-26 20:12:20 -0500 received badge  Good Question (source)
2017-02-27 09:21:35 -0500 received badge  Good Question (source)
2017-02-07 21:42:24 -0500 received badge  Good Question (source)
2016-12-15 03:44:29 -0500 received badge  Favorite Question (source)
2016-06-21 09:31:03 -0500 received badge  Nice Question (source)
2016-05-31 23:56:55 -0500 received badge  Favorite Question (source)
2015-12-22 05:16:51 -0500 received badge  Nice Question (source)
2015-11-18 06:22:05 -0500 received badge  Famous Question (source)
2015-07-30 07:58:52 -0500 received badge  Good Answer (source)
2015-07-30 07:58:52 -0500 received badge  Enlightened (source)
2015-06-22 09:25:39 -0500 commented question Shouldn't smach transition even if the action process has died?

I have it working now. I pasted the correct code now, which subclasses SimpleActionState and will abort the state in a separate heartbeat thread if it hasn't received feedback in 3 seconds. If you have any feedback that would be great, but I am marking this as answered. Thanks again.

2015-06-20 00:58:28 -0500 received badge  Notable Question (source)
2015-06-19 16:25:35 -0500 commented answer Shouldn't smach transition even if the action process has died?

Thank you very much. I added the code for my first pass at this suggestion to the question above. However, I am not sure how I can abort? Please take a look at the method/thread _heartbeat_timer() where I try to abort. What should I call to force an abort? Thanks!

2015-06-15 21:47:03 -0500 received badge  Popular Question (source)
2015-06-11 16:08:33 -0500 received badge  Commentator
2015-06-11 16:08:33 -0500 commented question Shouldn't smach transition even if the action process has died?

I found a related issue, but it doesn't say how to address the problem with smach: simpleactionstate-behaviour-if-action-server-crashes

2015-06-11 15:49:38 -0500 asked a question Shouldn't smach transition even if the action process has died?

Hello,

I am using a smach concurrent state machine and I want it to transition, even if one of the child states has died. It seems like it sits there waiting for the pre-emption to return, when it never will, since the process has died. This leads to undesirable behavior where the state machine will not transition to other states when command messages are sent.

My concurrent state is composed of the following states:

  • A simple action state that executes a long running behavior, implemented as a ROS nodelet.
  • A monitor state that subscribes to a ROS topic, and transitions when that topic is received.

This all works fine if the nodelet is running as expected. I can publish a topic which the monitor state listens for, the monitor state becomes invalid, and terminates, causing the outcome of the concurrent state to transition to a different state.

The problem comes when the simple action state has died (due to software bugs causing a crash.) Of course, I am fixing these bugs to prevent future crashes of the nodelet process. I am also now setting the problem nodelet to respawn in the launch file. However, for robustness, I would like for the state machine to still transition, even if this process has died.

Is this behavior by design or is there a way to force the concurrence behavior to transition, even if one of the children does not respond to the pre-emption request? In my outcome map, I am using the following, which I thought would cause it to terminate from the monitor state alone, but I think it is waiting for a response from the crashed nodelet.

child_termination_cb=(lambda so: True)

Thanks in advance!

Edit: I am adding my subclassed code for SimpleActionState: Edit2: The code is working now and properly aborts the state:

import roslib
import rospy
import smach
import smach_ros
from smach import State, StateMachine, CBState
from smach_ros import SimpleActionState, IntrospectionServer
from std_msgs.msg import Empty

import threading
import traceback
import copy

from actionlib.simple_action_client import SimpleActionClient, GoalStatus

import smach
from smach.state import *

__all__ = ['WatchdogActionState']

class WatchdogActionState(SimpleActionState):
    """Watchdog Simple action client state.  
       Subclasses the Smach SimpleActionState to provide watchdog capability on the actionserver process execution.
    """

"""Constructor for SimpleActionState action client wrapper."""
# Overridden constructor:
def __init__(self,
        # Action info
        action_name,
        action_spec, 
        # Feedback (heartbeat) timeout = how long to wait for a process that has died
        # before aborting this state.
        feedback_wait_timeout = rospy.Duration(3.0),
        # Default goal 
        goal = None,
        goal_key = None,
        goal_slots = [],
        goal_cb = None,
        goal_cb_args = [],
        goal_cb_kwargs = {},
        # Result modes
        result_key = None,
        result_slots = [],
        result_cb = None,
        result_cb_args = [],
        result_cb_kwargs = {},
        # Keys
        input_keys = [],
        output_keys = [],
        outcomes = ['succeeded','aborted','preempted'],
        # Timeouts
        exec_timeout = None,
        preempt_timeout = rospy.Duration(1.0),
        server_wait_timeout = rospy.Duration(1.0)
        ):

# Initialize base class
rospy.loginfo("init watchdog_action_state for action_name [%s], action_spec [%s]", action_name, action_spec)
SimpleActionState.__init__(self,
            action_name,
            action_spec, 
            goal,
            goal_key,
            goal_slots,
            goal_cb,
            goal_cb_args,
            goal_cb_kwargs,
            result_key,
            result_slots,
            result_cb,
            result_cb_args,
            result_cb_kwargs,
            input_keys,
            output_keys,
            outcomes,
            exec_timeout,
            preempt_timeout,
            server_wait_timeout)
    # The feedback (hearbeat) timeout
    self._feedback_wait_timeout = feedback_wait_timeout
rospy.loginfo("server_wait_timeout [%f]", self._feedback_wait_timeout.to_sec())
    self._feedback_time = rospy.Time ...
(more)
2014-11-25 13:48:27 -0500 received badge  Nice Answer (source)
2014-07-14 02:36:21 -0500 received badge  Famous Question (source)
2014-07-07 05:15:49 -0500 received badge  Famous Question (source)
2014-06-11 06:25:04 -0500 received badge  Famous Question (source)
2014-06-11 06:25:04 -0500 received badge  Notable Question (source)
2014-06-11 06:25:04 -0500 received badge  Popular Question (source)
2014-06-02 06:53:47 -0500 received badge  Famous Question (source)
2014-06-02 06:53:47 -0500 received badge  Notable Question (source)
2014-06-02 06:53:47 -0500 received badge  Popular Question (source)
2014-05-14 21:17:05 -0500 received badge  Self-Learner (source)
2014-05-14 21:17:05 -0500 marked best answer Can I roslaunch a rosjava node?

In previous versions of rosjava, I used to be able to start my node using roslaunch or rosrun. Now, it seems that to execute a node (as shown in the tutorials), I have to use the following syntax: ./my_pub_sub_tutorial com.github.rosjava_catkin_package_a.my_pub_sub_tutorial.Talker &

Please advise if it is still possible to use roslaunch and a launch file. I prefer to launch my java nodes this way, to be able to set parameters in a consistent way with my C++ based nodes. Now, I get an errror, "cannot launch node of type [execute]".

Also, it is not clear if I should be creating my rosjava subprojects as libraries (jar files) or executables to do this.

Thanks in advance.

2014-05-12 02:42:11 -0500 received badge  Famous Question (source)
2014-04-24 10:47:43 -0500 asked a question How to get boost libraries to link in cross compile?

I cannot get my cross compile to link to the boost libraries in my buildroot.

How can I get catkin/cmake to find the correct libraries (using the arm native libraries in my buildroot instead of the i386 system libraries)? I have tried updating LD_LIBRARY_PATH, and CMAKE_PREFIX_PATH, but I still get linker errors:

/usr/lib/gcc/arm-linux-gnueabi/4.4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lPocoFoundation
/usr/lib/gcc/arm-linux-gnueabi/4.4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lboost_signals-mt
/usr/lib/gcc/arm-linux-gnueabi/4.4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lboost_filesystem-mt
/usr/lib/gcc/arm-linux-gnueabi/4.4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -llog4cxx
/usr/lib/gcc/arm-linux-gnueabi/4.4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lboost_regex-mt
/usr/lib/gcc/arm-linux-gnueabi/4.4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lboost_date_time-mt
/usr/lib/gcc/arm-linux-gnueabi/4.4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lboost_system-mt
/usr/lib/gcc/arm-linux-gnueabi/4.4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lboost_thread-mt
/usr/lib/gcc/arm-linux-gnueabi/4.4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find /lib/libpthread.so.0
/usr/lib/gcc/arm-linux-gnueabi/4.4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find /usr/lib/libpthread_nonshared.a

I think this is because cmake does not like that there are multiple versions of this library on the system, even though I order them in the LD_LIBRARY_PATH!

-- catkin 0.5.86
-- Using these message generators: gencpp;genlisp;genpy
-- Boost version: 1.49.0
-- Found the following Boost libraries:
--   system
--   thread
-- Configuring done
CMake Warning at CMakeLists.txt:109 (add_library):
  Cannot generate a safe runtime search path for target gt_formation because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libPocoFoundation.so.9] in /usr/lib may be hidden by files in:
      /home/uav/rpi/rootfs/usr/lib
    runtime library [liblog4cxx.so.10] in /usr/lib may be hidden by files in:
      /home/uav/rpi/rootfs/usr/lib

  Some of these libraries may not be found correctly.

Yes, cmake, I know. I "hid" them on purpose. Why is it ignoring the CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY setting?

So, what is the correct way of forcing cmake to use the libs in the buildroot?

Here is my toolchain.cmake file:

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER arm-linux-gnueabi-gcc)
#$ENV{HOME}/rpi/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/arm-bcm2708-linux-gnueabi/bin/gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabi-g++-4.4)
set(CMAKE_FIND_ROOT_PATH $ENV{HOME}/rpi/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/arm-bcm2708-linux-gnueabi/sysroot $ENV{HOME}/rpi/rootfs $ENV{HOME}/rpi/rootfs/e2fsprogs-1.42.9 $ENV{HOME}/rpi/rootfs/usr $ENV{HOME}/rpi/rootfs/usr/lib $ENV{HOME}/rpi/rootfs/usr/include $ENV{HOME}/rpi/ros_catkin_ws/install_isolated $ENV{HOME}/rpi/ros_catkin_ws/install_isolated/lib)
set(CMAKE_LIBRARY_PATH $ENV{HOME}/rpi/ros_catkin_ws/install_isolated $ENV{HOME}/rpi/ros_catkin_ws/install_isolated/lib)
set(BOOST_LIBRARYDIR /home/uav/rpi/rootfs/usr/lib)
set(Boost_LIBRARY_DIRS /home/uav/rpi/rootfs/usr/lib)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Thanks in advance!