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

morten_nissov's profile - activity

2023-09-02 13:40:18 -0500 received badge  Enthusiast
2019-12-07 20:40:18 -0500 received badge  Famous Question (source)
2019-11-18 09:49:58 -0500 received badge  Famous Question (source)
2019-11-18 09:49:58 -0500 received badge  Notable Question (source)
2019-11-18 09:49:58 -0500 received badge  Popular Question (source)
2019-07-19 14:18:15 -0500 received badge  Notable Question (source)
2019-06-16 06:02:41 -0500 marked best answer rqt_graph not showing all active nodes

I've been following through the simple examples for actions and I'm not sure how to change the setting to get rqt_graph to show nodes a level "deeper".

The action is questions is an exact copy of the ones used in: link

The action node graph they get is: image description

The graph I get instead is: image description

and calling rostopic list -v returns:

morten@mortenThinkPad:~$ rostopic list

/fibonacci/cancel /fibonacci/feedback /fibonacci/goal /fibonacci/result /fibonacci/status /rosout /rosout_agg

I'm relatively new to ROS so I'm not quite sure what other information could be relevant. I'm running ubuntu 16.04LTS with ROS kinetic.

edit: adding picture now that I have enough karma

2019-06-16 06:02:11 -0500 received badge  Supporter (source)
2019-06-16 06:02:09 -0500 marked best answer action client stuck waiting on server

I've been trying to write an action file (cpp) using the Fibonacci example as a guide but so far it's just getting stuck on starting the server and i can't quite see why.

#include <stdio.h>
#include <std_msgs/String.h>

#include <ros/ros.h>
#include <actionlib/server/simple_action_server.h>
#include <actionlib/client/simple_action_client.h>

#include <mavros_msgs/SetMode.h>
#include <mavros_msgs/CommandBool.h>

#include <rovexp/ModeAction.h>

typedef actionlib::SimpleActionServer<rovexp::ModeAction> Server;
class ModeActionServer {
protected:
    ros::NodeHandle nh_;

    ros::ServiceClient arming_client_;
    ros::ServiceClient set_mode_client_;

    Server mode_server_;

    rovexp::ModeFeedback feedback_;
    rovexp::ModeResult result_;
    std::string action_name_;
public:
    ModeActionServer(std::string name) :
        mode_server_(nh_, name, boost::bind(&ModeActionServer::executeCB, this, _1), false),
        action_name_(name)
    {
        mode_server_.start();
        ROS_INFO("Mode action server started...");
    }
    ~ModeActionServer(void) { }

    void executeCB(const rovexp::ModeGoalConstPtr &goal)
    {
        ROS_INFO_STREAM("mode experiment started...");

        /*
        set_mode_client_ = nh_.serviceClient<mavros_msgs::SetMode>("mavros/set_mode");
        mavros_msgs::SetMode offb_set_mode;
        offb_set_mode.request.custom_mode = goal->mode_num;

        set_mode_client_.call(offb_set_mode);
        */

        arming_client_ = nh_.serviceClient<mavros_msgs::CommandBool>("mavros/cmd/arming");
        ros::Rate rate(20.0);
        mavros_msgs::CommandBool arm_cmd;
        arm_cmd.request.value = true;
        arming_client_.call(arm_cmd);
    }
};

typedef actionlib::SimpleActionClient<rovexp::ModeAction> Client;
void modeActionClient(uint8_t mode_num)
{
    Client client("mode_client", true);

    ROS_INFO("Waiting for action server to start");
    client.waitForServer();

    rovexp::ModeGoal goal;
    goal.mode_num = mode_num;
    printf("%d\t4\n",goal.mode_num);
    client.sendGoal(goal);

    client.waitForResult();
}

int main(int argc, char**argv)
{
    if(std::string(argv[1])=="-server")
    {
      ros::init(argc, argv, "mode_server");
      ModeActionServer server("mode_server");
      //server.start();
      ros::spin();

    }
    else if(std::string(argv[1])=="-client")
    {
        if ( std::string(argv[2])=="-h" ) {
            printf("Use: rosrun rovexp mode -client @mode\n"); 
            exit(-1);
        }
        ros::init(argc, argv, "mode_action_client");
        uint8_t mode_num = atoi(argv[2]);
        modeActionClient(mode_num);
    }
    printf("done\n");   
    return 0;
}

This is the action cpp file. After running the server and the client I get both "Mode action server started..." and "Waiting for action server to start" so I figure that means the client is getting caught up on ROS_INFO_STREAM("mode experiment started...");. I'm not quite sure why the server is taking so long to start up. I've also attempted the Fibonacci example in link and that works fine.

Ubuntu 16.04 LTS and ROS Kinetic.

2019-06-16 06:02:09 -0500 received badge  Scholar (source)
2019-06-16 06:02:06 -0500 commented answer action client stuck waiting on server

Thanks for the advice. And sorry I had totally forgotten to do that.

2019-06-11 14:22:29 -0500 received badge  Popular Question (source)
2019-06-11 06:24:32 -0500 commented answer rqt_graph not showing all active nodes

Ah okay, I'll try again without then.

2019-06-11 06:19:23 -0500 commented answer action client stuck waiting on server

I didn't notice that at all but yeah after doing that it works when run off a roscore on my computer. I'm currently us

2019-06-11 06:18:57 -0500 commented answer action client stuck waiting on server

I didn't notice that at all but yeah after doing that it works when run off a roscore on my computer. I'm currently us

2019-06-11 06:18:44 -0500 commented answer action client stuck waiting on server

I didn't notice that at all but yeah after doing that it works when run off a roscore on my computer. I'm currently us

2019-06-11 06:16:10 -0500 commented answer rqt_graph not showing all active nodes

The formatting got a little weird but I've added the output from rostopic list as well.

2019-06-11 06:15:44 -0500 edited question rqt_graph not showing all active nodes

rqt_graph not showing all active nodes I've been following through the simple examples for actions and I'm not sure how

2019-06-11 06:15:29 -0500 edited question rqt_graph not showing all active nodes

rqt_graph not showing all active nodes I've been following through the simple examples for actions and I'm not sure how

2019-06-11 06:15:14 -0500 edited question rqt_graph not showing all active nodes

rqt_graph not showing all active nodes I've been following through the simple examples for actions and I'm not sure how

2019-06-11 06:14:41 -0500 edited question rqt_graph not showing all active nodes

rqt_graph not showing all active nodes I've been following through the simple examples for actions and I'm not sure how

2019-06-11 06:14:15 -0500 edited question rqt_graph not showing all active nodes

rqt_graph not showing all active nodes I've been following through the simple examples for actions and I'm not sure how

2019-06-11 06:13:07 -0500 edited question rqt_graph not showing all active nodes

rqt_graph not showing all active nodes I've been following through the simple examples for actions and I'm not sure how

2019-06-11 06:12:27 -0500 edited question rqt_graph not showing all active nodes

rqt_graph not showing all active nodes I've been following through the simple examples for actions and I'm not sure how

2019-06-11 06:12:27 -0500 received badge  Editor (source)
2019-06-11 06:10:21 -0500 commented question rqt_graph not showing all active nodes

Thanks for the reminder, I've just done so.

2019-06-11 06:10:03 -0500 edited question rqt_graph not showing all active nodes

rqt_graph not showing all active nodes I've been following through the simple examples for actions and I'm not sure how

2019-06-11 01:55:36 -0500 commented answer rqt_graph not showing all active nodes

After selecting the "nodes/topics (all)" topic the graph doesn't change. Do I need to reload the image.

2019-06-10 19:34:53 -0500 asked a question action client stuck waiting on server

action client stuck waiting on server I've been trying to write an action file (cpp) using the Fibonacci example as a gu

2019-06-10 19:34:53 -0500 asked a question rqt_graph not showing all active nodes

rqt_graph not showing all active nodes I've been following through the simple examples for actions and I'm not sure how