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

piraka9011's profile - activity

2020-05-18 04:50:38 -0500 received badge  Famous Question (source)
2020-05-18 04:50:38 -0500 received badge  Notable Question (source)
2020-03-06 11:35:38 -0500 commented answer Installing ros-melodic-desktop uninstalls python3-catkin-pkg

Thank you for the explanation

2020-03-06 11:35:30 -0500 marked best answer Installing ros-melodic-desktop uninstalls python3-catkin-pkg

See relevant GitHub tracking ticket with more info and steps here.

I am attempting to build a ROS2 package that uses ROS1 bridge (rosbag2_bag_v2) in a GitHub Actions CI pipeline. I am able to install the dependencies for ROS1 which include python3-catkin-pkg. However, when I run apt-get install ros-melodic-desktop, it automatically removes python3-catkin-pkg:

The following packages will be REMOVED: python3-catkin-pkg python3-rosdep python3-rosdep-modules python3-rosdistro python3-rospkg

Is there a reason this occurs and is it possible to install a ROS1 distro without removing python3-catkin-pkg

2020-03-06 11:35:26 -0500 received badge  Popular Question (source)
2020-03-04 10:09:31 -0500 asked a question Installing ros-melodic-desktop uninstalls python3-catkin-pkg

Installing ros-melodic-desktop uninstalls python3-catkin-pkg See relevant GitHub tracking ticket with more info and step

2019-06-10 22:47:24 -0500 received badge  Famous Question (source)
2019-05-20 01:05:03 -0500 marked best answer Message Filters Time Sequencer not compiling - Roscpp

I'm trying to utilize the ROS Indigo message_filters::TimeSequencer library to delay messages coming in from a certain topic and republishing them onto a new topic. However, my code does not compile and I get the following error: https://pastebin.com/iUavjXR2 which states that I have mismatched types for my callback.

EDIT: I have compiled this on kinetic and it seems to be working... I am trying to find out why though and will update this when I find an answer.

Below is my code

#include <ros/ros.h>
#include <geometry_msgs/TwistStamped.h>
#include <message_filters/time_sequencer.h>
#include <message_filters/subscriber.h>

using namespace geometry_msgs;
using namespace message_filters;

ros::Publisher pub;

void delay_cb(const TwistStampedConstPtr& delay_vel)
{
    TwistStamped new_vel;
    new_vel.header.stamp = ros::Time::now();
    new_vel.twist.angular.z = delay_vel->twist.angular.z;
    new_vel.twist.linear.x = delay_vel->twist.linear.x;
    pub.publish(new_vel);
}

int main(int argc, char** argv)
{
    ros::init(argc, argv, "delay_node");
    ros::NodeHandle n;
    double delay_time = 1.0;
    std::string delay_topic = "/jackal_bsc/key_vel_stamped";
    std::string new_topic = "/jackal_bsc/key_vel_delay";
    n.param<std::string>("/jackal_bsc/delay_topic", delay_topic, "/jackal_bsc/key_vel_stamped");
    n.param<std::string>("/jackal_bsc/new_topic", new_topic, "/jackal_bsc/key_vel_delay");
    n.param("/jackal_bsc/delay_time", delay_time, 1.0);
    pub = n.advertise<TwistStamped>(new_topic, 10);
    message_filters::Subscriber<TwistStamped> sub(n, delay_topic, 1);
    message_filters::TimeSequencer<TwistStamped> seq(sub, ros::Duration(0.1), 
                                                      ros::Duration(0.01), 10);
    seq.registerCallback(delay_cb);
    ros::spin();
    return 0;
}

I'm using a constant pointer in my callback, and I've followed the ROS tutorials for message_filters to the T. What could be my issue?

Thanks!

Edit: I put the error in the pastebin link but at gvdhoorn's request, ill put it here:

In file included from /opt/ros/indigo/include/message_filters/time_sequencer.h:41:0,
                 from /home/piraka9011/catkin_ws/src/jackal_bsc/src/delay_node.cpp:4:
/opt/ros/indigo/include/message_filters/simple_filter.h: In instantiation of ‘message_filters::Connection message_filters::SimpleFilter<M>::registerCallback(void (*)(P)) [with P = const boost::shared_ptr<const geometry_msgs::TwistStamped_<std::allocator<void> > >&; M = geometry_msgs::TwistStamped_<std::allocator<void> >]’:
/home/piraka9011/catkin_ws/src/jackal_bsc/src/delay_node.cpp:34:34:   required from here
/opt/ros/indigo/include/message_filters/simple_filter.h:96:99: error: no matching function for call to ‘message_filters::Signal1<geometry_msgs::TwistStamped_<std::allocator<void> > >::addCallback(void (*&)(const boost::shared_ptr<const geometry_msgs::TwistStamped_<std::allocator<void> > >&))’
     return Connection(boost::bind(&Signal::removeCallback, &signal_, signal_.addCallback(callback)));
                                                                                                   ^
/opt/ros/indigo/include/message_filters/simple_filter.h:96:99: note: candidate is:
In file included from /opt/ros/indigo/include/message_filters/simple_filter.h:41:0,
                 from /opt/ros/indigo/include/message_filters/time_sequencer.h:41,
                 from /home/piraka9011/catkin_ws/src/jackal_bsc/src/delay_node.cpp:4:
/opt/ros/indigo/include/message_filters/signal1.h:91:22: note: template<class P> message_filters::Signal1<M>::CallbackHelper1Ptr message_filters::Signal1<M>::addCallback(const boost::function<void(P)>&) [with P = P; M = geometry_msgs::TwistStamped_<std::allocator<void> >]
   CallbackHelper1Ptr addCallback(const boost::function<void(P)>& callback)
                      ^
/opt/ros/indigo/include/message_filters/signal1.h:91:22: note:   template argument deduction/substitution failed:
In file included from /opt/ros/indigo ...
(more)
2019-04-08 01:18:25 -0500 marked best answer Remapping move_base Twist publisher topic.

Hi all,

I'm working with a Clearpath Husky on ROS Indigo, Ubuntu 14.04. I'm trying to remap the topic that move_base publishes its Twist messages on to ('cmd_vel') to another name that I can use with a topic_tools mux. I was able to do so by changing the move_base.launch file in the jackal_navigation package, however, I want to know if there's a way to do so without changing the source of the original package.

I created my own launch file that launches the jackal_navigation amcl_navigation.launch file and tried to remap the move_base publishing topic using <remap from="cmd_vel" to="/new_cmd_vel"/>, however, this did not work.

Are there any services or parameters that I am unaware of that remap the navigation stacks Twist message publisher?

Thanks in advance!

Edit: Below is the launch file I am using and how I tried to remap the topic

<launch>
    <include file="$(find jackal_gazebo)/launch/jackal_world.launch">
        <arg name="config" value="front_laser"/>
    </include>
    <include file="$(find jackal_navigation)/launch/amcl_demo.launch">
        <arg name="map_file" value="/home/river/gazebo_map.yaml"/>
        <!-- This is how I tried to change it -->
        <remap from="cmd_vel" to="/nav_vel"/>
    </include>
    <include file="$(find jackal_viz)/launch/view_robot.launch">
        <arg name="config" value="localization"/>
    </include>
    <!-- How I would like to use my renamed topic (in a multiplexer) -->
    <node name="topic_tools_mux" pkg="topic_tools" type="mux" 
        args="/cmd_vel /bsc_jackal/bsc_vel /bsc_jackal/key_vel /bsc_jackal/nav_vel mux:=bsc_mux">
    </node> 
</launch>

Below is the modified source launch file for Jackal in jackal_navigation/launch/include/move_base.launch:

<launch>
    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find jackal_navigation)/params/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find jackal_navigation)/params/costmap_common_params.yaml" command="load" ns="local_costmap" />

    <rosparam file="$(find jackal_navigation)/params/map_nav_params/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find jackal_navigation)/params/map_nav_params/global_costmap_params.yaml" command="load" />

    <rosparam file="$(find jackal_navigation)/params/base_local_planner_params.yaml" command="load" />
    <rosparam file="$(find jackal_navigation)/params/move_base_params.yaml" command="load" />

    <param name="base_global_planner" type="string" value="navfn/NavfnROS" />
    <param name="base_local_planner" value="base_local_planner/TrajectoryPlannerROS"/>

    <remap from="odom" to="odometry/filtered" />
    <!-- Here is where I remapped the topic -->
    <remap from="cmd_vel" to="/bsc_jackal/nav_vel"/>
  </node>
</launch>

Below is the output of rostopic list | grep vel as Procopio requested. /bsc_jackal/* are the topics generated from the topic_tools mux. /jackal_velocity_controller/cmd_vel is just a relay to /cmd_vel using topic tools (I found this out by looking at the jackal source launch files).

/bsc_jackal/bsc_vel
/bsc_jackal/key_vel
/bsc_jackal/nav_vel
/cmd_vel
/jackal_velocity_controller/cmd_vel
/jackal_velocity_controller/odom
/navsat/fix/velocity/parameter_descriptions
/navsat/fix/velocity/parameter_updates
/navsat/vel
2019-01-18 23:28:20 -0500 received badge  Notable Question (source)
2019-01-18 23:28:20 -0500 received badge  Popular Question (source)
2019-01-18 23:28:20 -0500 received badge  Famous Question (source)
2018-09-18 19:51:33 -0500 marked best answer Getting 'rosgraph resource not found' when trying to get turtlebot local_plan?

Hi,

I'm trying to get the 'geometry_msgs/Poses' message from the '/move_base/DWAPlannerROS/local_plan' topic for the Kobuki Turtlebot. My current code is as follows: (This is an extremely minimal implementation where I am just accessing the value of the X position).

#!/usr/bin/env python
import rospy
from nav_msgs.msg import Path

def callback(data):
    global xPos
    xPos = data.Pose.position.X;

def getPlan():
    rospy.init_node('plangetter', anonymous=False);

    while not rospy.is_shutdown():
        rospy.Subscriber('/move_base/DWAPlannerROS/local_plan', Path, callback);
        rospy.sleep(1);
        print "X is: " + xPos;

if __name__ == '__main__':
    try:
        getPlan();
    except rospy.ROSInterruptException:
        pass

My questions are:

1) Why am I getting a 'rospkg.common.ResourceNotFound: rosgraph' error when running this code? I have checked my ROS_PACKAGE_PATH and used rospack find rosgraph to confirm that ROS has access to the package. I have also made sure my PYTHONPATH is correct.

2) Am I correctly subscribing to the topic and getting the data? If not, what is the correct way?

Thanks in advance!

2018-07-16 08:29:06 -0500 marked best answer Callback function not updating values (Rospy)

I have a program used to read in command velocities from two sources (teleop/navigation), blend them, and then publish the blended velocity to the Turtlebot. While debugging, I noticed that the code never reaches the callback functions and thus, does not update any of the values I need to read in. I have the following:

class BSCFun:

    def __init__(self):
        # Init Node
        rospy.init_node('BSCFun', anonymous=True, log_level=rospy.DEBUG);
        self.pub = rospy.Publisher('/mobile_base/commands/velocity', Twist, queue_size=100);

        # ROS Subscribers
        self.odomSub = rospy.Subscriber('/odom', Odometry, self.odomCallback);
        self.goalSub = rospy.Subscriber('/move_base/current_goal', PoseStamped, self.goalCallback)
        self.velSub = rospy.Subscriber('/cmd_vel_mux/input/navi', Twist, self.optCmdCallback)
        self.teleSub = rospy.Subscriber('/cmd_vel_mux/input/teleop', Twist, self.userCmdCallback);
        self.rate = rospy.Rate(5);

        # Main Loop
        while not rospy.is_shutdown():
            self.BSCFun1();

    def BSCFun1(self):
        # do stuff and get a 'newVelocity'
        vMsg = Twist();
        vMsg.angular.z = newVelocity;
        self.pub.publish(vMsg);
        self.rate.sleep();

    def userCmdCallback(self, msg):
        self.xVelUser= msg.linear.x;
        self.wzVelUser = msg.angular.z; 

    def optCmdCallback(self, msg):
        self.xVel = msg.linear.x;
        self.wzVel = msg.angular.z;
        rospy.loginfo("Updating Opt. Cmd.");

and a bunch of other callbacks.

if __name__ == '__main__':
    try:
        bsc = BSCFun();
    except rospy.ROSInterruptException:
        pass

I use the data from the callbacks in BSCFun1() to calculate a newVelocity and publish accordingly, but the values are not updating and all I get are zeros (the values my variables are initialized in. What seems to be the problem?

2018-04-12 20:51:52 -0500 received badge  Notable Question (source)
2018-04-12 20:51:52 -0500 received badge  Famous Question (source)
2018-03-23 06:40:42 -0500 received badge  Famous Question (source)
2018-03-12 03:16:18 -0500 received badge  Notable Question (source)
2018-03-11 16:57:23 -0500 received badge  Commentator
2018-03-11 16:57:23 -0500 commented question CMake: Iterate over multiple source files for multiple executables

@gvdhoorn exactly, each condition has to be a separate executable.

2018-03-09 21:59:29 -0500 received badge  Popular Question (source)
2018-03-09 20:16:30 -0500 edited question CMake: Iterate over multiple source files for multiple executables

CMake: Iterate over multiple source files for multiple executables Hi, I am trying to minimize the size of my CMakeList

2018-03-09 20:02:21 -0500 edited question Message Filters Time Sequencer not compiling - Roscpp

Message Filters Time Sequencer not compiling - Roscpp I'm trying to utilize the ROS Indigo message_filters::TimeSequence

2018-03-09 19:58:33 -0500 received badge  Popular Question (source)
2018-03-08 21:27:31 -0500 asked a question CMake: Iterate over multiple source files for multiple executables

CMake: Iterate over multiple source files for multiple executables Hi, I am trying to minimize the size of my CMakeList

2018-02-23 06:53:51 -0500 edited question Message Filters Time Sequencer not compiling - Roscpp

Message Filters Time Sequencer not compiling - Roscpp I'm trying to utilize the ROS Indigo message_filters::TimeSequence

2018-02-23 06:53:16 -0500 edited question Message Filters Time Sequencer not compiling - Roscpp

Message Filters Time Sequencer not compiling - Roscpp I'm trying to utilize the ROS Indigo message_filters::TimeSequence

2018-02-22 09:32:53 -0500 asked a question Message Filters Time Sequencer not compiling - Roscpp

Message Filters Time Sequencer not compiling - Roscpp I'm trying to utilize the ROS Indigo message_filters::TimeSequence

2018-02-14 07:44:43 -0500 commented question Remapping move_base Twist publisher topic.

@Procopio please see my edit.

2018-02-14 07:44:24 -0500 edited question Remapping move_base Twist publisher topic.

Remapping move_base Twist publisher topic. Hi all, I'm working with a Clearpath Husky on ROS Indigo, Ubuntu 14.04. I'm

2018-02-08 11:09:17 -0500 received badge  Notable Question (source)
2018-02-08 08:41:29 -0500 commented answer Remapping move_base Twist publisher topic.

Since this launch file is being used by other packages, wouldn't I have to make sure that all the other packages can 'se

2018-02-08 08:38:30 -0500 edited question Remapping move_base Twist publisher topic.

Remapping move_base Twist publisher topic. Hi all, I'm working with a Clearpath Husky on ROS Indigo, Ubuntu 14.04. I'm

2018-02-08 05:44:42 -0500 received badge  Popular Question (source)
2018-02-06 14:36:35 -0500 asked a question Remapping move_base Twist publisher topic.

Remapping move_base Twist publisher topic. Hi all, I'm working with a Clearpath Husky on ROS Indigo, Ubuntu 14.04. I'm

2018-01-23 08:09:00 -0500 commented answer Callback function not updating values (Rospy)

@wh11868 See my first comment for one approach. My current approach is to make a separate thread, using python's Threadi

2018-01-16 03:04:40 -0500 received badge  Famous Question (source)
2017-11-28 14:48:27 -0500 received badge  Student (source)
2017-05-26 12:20:43 -0500 received badge  Famous Question (source)
2017-05-17 19:12:01 -0500 received badge  Famous Question (source)
2017-03-29 15:32:40 -0500 received badge  Famous Question (source)
2016-11-21 15:11:41 -0500 commented answer Delay incoming messages

So this actually worked! Very much appreciated. My implementation had an if/else statement that would decide if we wanted to have a delay or not in the original callback. Either way, good use of timers.

2016-11-21 14:39:08 -0500 received badge  Notable Question (source)
2016-11-19 03:03:12 -0500 received badge  Popular Question (source)
2016-11-18 22:54:43 -0500 commented answer Delay incoming messages

This is an interesting way of going about it...plus you reminded me how to pass two arguments to a callback (did it before but forgot how!) I will test this out when I get to work, thanks.

2016-11-18 12:58:35 -0500 asked a question Delay incoming messages

Is there a way in Rospy to delay incoming messages? Specifically, I wish to delay incoming velocity commands for teleop.

I can't use a sleep because I still need my program/node to run other processes. I was wondering whether the queue size would have something to do with it?

Thanks!