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

dinesh's profile - activity

2023-10-10 01:00:06 -0500 received badge  Famous Question (source)
2023-10-10 01:00:06 -0500 received badge  Notable Question (source)
2023-08-10 07:34:23 -0500 received badge  Popular Question (source)
2023-07-30 20:17:44 -0500 marked best answer how to remove this error in pcl?

Could not find a package configuration file provided by "pcl_conversions" with any of the following names:

pcl_conversionsConfig.cmake
pcl_conversions-config.cmake

after running catkin_make to build the pcl package this error always comes, im tired of this error. o man.

2023-07-12 09:59:50 -0500 received badge  Popular Question (source)
2023-07-12 09:59:50 -0500 received badge  Notable Question (source)
2023-07-11 10:53:17 -0500 marked best answer what are imax and imin in pid

I was trying to use the pid controller of the control toolbox ros package in my hardware interface of diff drive controller. Here when i was studing this api i didn't got what imax and imin means and what it does. What i'm trying to do it use this in the hardware interface of the diff drive robot i'm making where their is presence of velocity feedback sensors like wheel encoders which is sending the actual angular velocity and use this to calculate the velocity differnece i.e error and send appropirate pwm singnals to the motor.

2023-07-02 08:49:50 -0500 received badge  Famous Question (source)
2023-06-14 13:51:22 -0500 received badge  Famous Question (source)
2023-06-14 13:51:22 -0500 received badge  Notable Question (source)
2023-06-09 09:33:57 -0500 received badge  Popular Question (source)
2023-06-09 09:33:57 -0500 received badge  Notable Question (source)
2023-05-30 05:13:36 -0500 received badge  Famous Question (source)
2023-05-16 03:40:59 -0500 received badge  Notable Question (source)
2023-05-16 03:40:59 -0500 received badge  Famous Question (source)
2023-05-04 23:06:23 -0500 received badge  Popular Question (source)
2023-05-04 23:06:23 -0500 received badge  Famous Question (source)
2023-05-04 23:06:23 -0500 received badge  Notable Question (source)
2023-04-13 01:11:38 -0500 received badge  Notable Question (source)
2023-04-01 02:58:18 -0500 received badge  Famous Question (source)
2023-03-14 12:51:13 -0500 received badge  Nice Question (source)
2023-03-14 12:51:12 -0500 marked best answer pass arg to ros node in launch file

How do i properly pass argument to ros node in ros launch file? Here is the ros node which i want to launch from a roslaunch file:

> <launch>   <node name="2d_obj_rec"
> pkg="advanced_vision_pkg"
> type="2d_obj_rec" args="image"
>     output="screen"/> </launch>

Here i want to pass image arugment like " rosrun advanced_vision_pkg 2d_obj_rec image:=/camera/image"
when i launch the file using cmd " roslaunch advanced_vision_pkg 2d_obj_rec.launch image:=/camera/image" it is not working.

2023-03-12 16:51:08 -0500 received badge  Famous Question (source)
2023-03-12 16:51:08 -0500 received badge  Notable Question (source)
2023-03-12 16:51:08 -0500 received badge  Popular Question (source)
2023-03-07 18:17:55 -0500 received badge  Popular Question (source)
2023-03-07 18:17:55 -0500 received badge  Notable Question (source)
2023-03-07 18:17:55 -0500 received badge  Famous Question (source)
2023-02-26 23:51:47 -0500 received badge  Famous Question (source)
2023-02-21 02:19:22 -0500 received badge  Famous Question (source)
2023-02-04 04:09:59 -0500 received badge  Popular Question (source)
2023-02-04 04:09:59 -0500 received badge  Notable Question (source)
2023-01-19 01:44:33 -0500 marked best answer error with action server and client

When i run below action server and client, i'm getting error:

[INFO] [WallTime: 1490393212.373839] /fibonacci: Succeeded
[INFO] [WallTime: 1490393212.374787] /fibonacci: Succeeded
[ERROR] [WallTime: 1490393212.375245] To transition to a succeeded state, the goal must be in a preempting or active state, it is currently in state: 3

My action server is:

   #! /usr/bin/env python

import rospy

import actionlib

from control_msgs.msg import (
    FollowJointTrajectoryGoal,
    FollowJointTrajectoryActionResult,
    FollowJointTrajectoryAction,
    FollowJointTrajectoryActionFeedback,
)

class FibonacciAction(object):
    # create messages that are used to publish feedback/result
    _feedback = FollowJointTrajectoryActionFeedback()
    _result = FollowJointTrajectoryActionResult()

    def __init__(self, name):
        self._action_name = name
        self._as = actionlib.SimpleActionServer(self._action_name, FollowJointTrajectoryAction, execute_cb=self.execute_cb, auto_start = False)
        self._as.start()

    def execute_cb(self, _goal):
        r = rospy.Rate(1)
        success = True

        # start executing the action
        for i in range(0, 2):
            # check that preempt has not been requested by the client
            if self._as.is_preempt_requested():
                rospy.loginfo('%s: Preempted' % self._action_name)
                self._as.set_preempted()
                success = False

            self._feedback.feedback.header.seq = 1
            self._as.publish_feedback(self._feedback.feedback)

            if success:
                self._result.header = self._feedback.header
                rospy.loginfo('%s: Succeeded' % self._action_name)
                self._as.set_succeeded(self._result.result)


if __name__ == '__main__':
    rospy.init_node('fibonacci')
    server = FibonacciAction(rospy.get_name())
    rospy.spin()

And my action client is:

    #include <ros/ros.h>
#include <actionlib/client/simple_action_client.h>
#include <actionlib/client/terminal_state.h>
#include <control_msgs/FollowJointTrajectoryAction.h>
int main (int argc, char **argv)
{
  ros::init(argc, argv, "fibonacci_client_py");

  // create the action client
  // true causes the client to spin its own thread
  actionlib::SimpleActionClient<control_msgs::FollowJointTrajectoryAction> ac("fibonacci", true);

  ROS_INFO("Waiting for action server to start.");
  // wait for the action server to start
  ac.waitForServer(); //will wait for infinite time

  ROS_INFO("Action server started, sending goal.");
  // send a goal to the action
  control_msgs::FollowJointTrajectoryGoal goal;

    goal.trajectory.joint_names.push_back("joint1");
    goal.trajectory.joint_names.push_back("joint2");

    // We will have two waypoints in this goal trajectory
    goal.trajectory.points.resize(2);

    // First trajectory point
    // Positions
    int ind = 0;
    goal.trajectory.points[ind].positions.resize(2);
    goal.trajectory.points[ind].positions[0] = 1.0;
    goal.trajectory.points[ind].positions[1] = 1.0;
    // Velocities
    goal.trajectory.points[ind].velocities.resize(2);
    for (size_t j = 0; j < 2; ++j)
    {
      goal.trajectory.points[ind].velocities[j] = 0.0;
    }
    // To be reached 1 second after starting along the trajectory
    goal.trajectory.points[ind].time_from_start = ros::Duration(1.0);

    // Second trajectory point
    // Positions
    ind += 1;
    goal.trajectory.points[ind].positions.resize(2);
    goal.trajectory.points[ind].positions[0] = 1;
    goal.trajectory.points[ind].positions[1] = 2;
    // Velocities
    goal.trajectory.points[ind].velocities.resize(2);
    for (size_t j = 0; j < 2; ++j)
    {
      goal.trajectory.points[ind].velocities[j] = 0.0;
    }
    // To be reached 2 seconds after starting along the trajectory
    goal.trajectory.points[ind].time_from_start = ros::Duration(2.0);
  ac.sendGoal(goal);

  //wait for the action to return
  bool finished_before_timeout = ac.waitForResult(ros::Duration(30.0));

  if (finished_before_timeout)
  {
    actionlib::SimpleClientGoalState state = ac.getState();
    ROS_INFO("Action finished: %s",state.toString().c_str());
  }
  else
    ROS_INFO("Action did not finish before the time out.");

  //exit
  return 0;
}
2023-01-10 03:09:23 -0500 edited question diff drive controller not calculating accurate odom

diff drive controller not calculating accurate odom twist x When i send input cmd velocity the motor driver rotating at

2023-01-10 03:08:57 -0500 asked a question diff drive controller not calculating accurate odom

diff drive controller not calculating accurate odom twist x When i send input cmd velocity the motor driver rotating at

2022-12-29 07:40:49 -0500 received badge  Famous Question (source)
2022-12-26 03:53:06 -0500 marked best answer undefined reference to KDL::Rotation::Quaternion

I am using orocos toolchain 2.9, ros kinetic, ubunt u16.

CMakeFiles/localisation-component.dir/src/localisation-component.cpp.o: In function `Localisation::updateHook()':
localisation-component.cpp:(.text._ZN12Localisation10updateHookEv[_ZN12Localisation10updateHookEv]+0xd3): undefined reference to `KDL::Rotation::Quaternion(double, double, double, double)'
localisation-component.cpp:(.text._ZN12Localisation10updateHookEv[_ZN12Localisation10updateHookEv]+0xe6): undefined reference to `KDL::epsilon'
localisation-component.cpp:(.text._ZN12Localisation10updateHookEv[_ZN12Localisation10updateHookEv]+0x10b): undefined reference to `KDL::Rotation::GetRotAngle(KDL::Vector&, double) const'
collect2: error: ld returned 1 exit status
youbot-controller/CMakeFiles/localisation-component.dir/build.make:133: recipe for target '/home/robot/youbot_catkin_ws/devel/lib/orocos/gnulinux/youbot-controller/liblocalisation-component-gnulinux.so' failed
make[2]: *** [/home/robot/youbot_catkin_ws/devel/lib/orocos/gnulinux/youbot-controller/liblocalisation-component-gnulinux.so] Error 1
CMakeFiles/Makefile2:1273: recipe for target 'youbot-controller/CMakeFiles/localisation-component.dir/all' failed
make[1]: *** [youbot-controller/CMakeFiles/localisation-component.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

My CmakeLists.txt file is:

cmake_minimum_required(VERSION 2.8.3)
project(youbot-controller)

### ROS Dependencies ###
# Find the RTT-ROS package (this transitively includes the Orocos CMake macros)
find_package(catkin REQUIRED COMPONENTS
  rtt_ros

  rtt_tf
  # ADDITIONAL ROS PACKAGES
  )

find_package(orocos_kdl)
find_package(kdl_parser)

include_directories(${catkin_INCLUDE_DIRS})

### Orocos Dependencies ###
# Note that orocos_use_package() does not need to be called for any dependency
# listed in the package.xml file

include_directories(${USE_OROCOS_INCLUDE_DIRS})

### Orocos Targets ###

orocos_component(localisation-component src/localisation-component.cpp)
target_link_libraries(localisation-component ${catkin_LIBRARIES} ${USE_OROCOS_LIBRARIES})

# orocos_library(my_library src/my_library.cpp)
# target_link_libraries(my_library ${catkin_LIBRARIES} ${USE_OROCOS_LIBRARIES})

# orocos_service(my_service src/my_service.cpp)
# target_link_libraries(my_service ${catkin_LIBRARIES} ${USE_OROCOS_LIBRARIES})

# orocos_plugin(my_plugin src/my_plugin.cpp)

# target_link_libraries(my_plugin ${catkin_LIBRARIES} ${USE_OROCOS_LIBRARIES})

# orocos_typekit(my_typekit src/my_typekit.cpp)
# target_link_libraries(my_typekit ${catkin_LIBRARIES} ${USE_OROCOS_LIBRARIES})

### Orocos Package Exports and Install Targets ###

# Generate install targets for header files

orocos_install_headers(DIRECTORY include/${PROJECT_NAME})

# Export package information (replaces catkin_package() macro) 
orocos_generate_package(
  INCLUDE_DIRS include
  DEPENDS rtt_ros
  )

the src file is:

#ifndef OROCOS_LOCALISATION_COMPONENT_HPP
#define OROCOS_LOCALISATION_COMPONENT_HPP

#include <rtt/RTT.hpp>
#include <iostream>
#include <geometry_msgs/Pose2D.h>
#include <geometry_msgs/TransformStamped.h>
#include <kdl/frames.hpp>

class Localisation
    : public RTT::TaskContext
{
    geometry_msgs::TransformStamped tfs;
    RTT::OutputPort<geometry_msgs::Pose2D> outpose;
 public:
    Localisation(std::string const& name)
        : TaskContext(name, PreOperational)
    {
        addPort("pose", outpose).doc("Contains latest Youbot Pose.");
    }

    bool configureHook() {
        /** Check in here that we can call rtt_tf */
        return false;
    }

    void updateHook() {
        try {
            /* tfs = ...call rtt_tf and query the transform /odom to /base_footprint ... ; */
        } catch (...) {
            return;
        }
        geometry_msgs::Pose2D pose;
        pose.x = tfs.transform.translation.x;
        pose.y = tfs.transform.translation.y;
        geometry_msgs::Quaternion qu = tfs.transform.rotation;
        KDL::Rotation rot = KDL::Rotation::Quaternion(qu.x, qu.y, qu.z, qu.w);
        KDL::Vector v;
        pose.theta = rot.GetRotAngle(v);
        outpose.write(pose);
    }
};

#endif
2022-12-02 19:30:19 -0500 received badge  Famous Question (source)
2022-11-25 23:00:56 -0500 received badge  Notable Question (source)
2022-11-25 23:00:56 -0500 received badge  Famous Question (source)
2022-11-22 13:09:01 -0500 received badge  Famous Question (source)
2022-11-13 03:47:29 -0500 received badge  Famous Question (source)
2022-11-10 14:53:08 -0500 received badge  Famous Question (source)
2022-11-09 02:41:23 -0500 received badge  Famous Question (source)
2022-10-28 05:22:47 -0500 marked best answer error: reference to ‘_1’ is ambiguous

I'm trying to use the pcl_conversion functions in my ros2 subscriber node. Here is my code:

#include


#include "rclcpp/rclcpp.hpp"
#include "sensor_msgs/msg/point_cloud2.hpp"

#include "pcl_conversions/pcl_conversions.h"

using std::placeholders::_1;
#define BOOST_BIND_NO_PLACEHOLDERS

class RobotVisioin : public rclcpp::Node
{
  public:
    RobotVisioin() : Node("robot_vision")
    {
      subscription_ = this->create_subscription<sensor_msgs::msg::PointCloud2>(
      "/camera/depth/color/points", 10, std::bind(&RobotVisioin::topic_callback, this, _1));
    }

  private:
    void topic_callback(const sensor_msgs::msg::PointCloud2::SharedPtr msg) const
    {
      RCLCPP_INFO(this->get_logger(), "I heard: '%s'", msg->data);
    }

    rclcpp::Subscription<sensor_msgs::msg::PointCloud2>::SharedPtr subscription_;
};

int main(int argc, char * argv[])
{
  rclcpp::init(argc, argv);
  rclcpp::spin(std::make_shared<RobotVisioin>());
  rclcpp::shutdown();
  return 0;
}

But i'm getting below error:

/home/ubuntu/turtlebot/src/robot_vision_cpp/src/robot_vision.cpp: In constructor ‘RobotVisioin::RobotVisioin()’:
/home/ubuntu/turtlebot/src/robot_vision_cpp/src/robot_vision.cpp:17:88: error: reference to ‘_1’ is ambiguous
   17 |       "/camera/depth/color/points", 10, std::bind(&RobotVisioin::topic_callback, this, _1));
      |                                                                                        ^~
In file included from /usr/include/boost/bind/bind.hpp:2356,
                 from /usr/include/boost/bind.hpp:22,
                 from /usr/include/boost/signals2/slot.hpp:15,
                 from /usr/include/boost/signals2/connection.hpp:24,
                 from /usr/include/boost/signals2/signal.hpp:22,
                 from /usr/include/boost/signals2.hpp:19,
                 from /usr/include/pcl-1.10/pcl/io/boost.h:64,
                 from /usr/include/pcl-1.10/pcl/io/file_io.h:42,
                 from /usr/include/pcl-1.10/pcl/io/pcd_io.h:44,
                 from /opt/ros/foxy/include/pcl_conversions/pcl_conversions.h:72,
                 from /home/ubuntu/turtlebot/src/robot_vision_cpp/src/robot_vision.cpp:6:
/usr/include/boost/bind/placeholders.hpp:46:38: note: candidates are: ‘constexpr const boost::arg<1> boost::placeholders::_1’
   46 | BOOST_STATIC_CONSTEXPR boost::arg<1> _1;
      |                                      ^~
In file included from /opt/ros/foxy/include/rclcpp/context.hpp:19,
                 from /opt/ros/foxy/include/rclcpp/contexts/default_context.hpp:18,
                 from /opt/ros/foxy/include/rclcpp/executor.hpp:32,
                 from /opt/ros/foxy/include/rclcpp/executors/multi_threaded_executor.hpp:25,
                 from /opt/ros/foxy/include/rclcpp/executors.hpp:21,
                 from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146,
                 from /home/ubuntu/turtlebot/src/robot_vision_cpp/src/robot_vision.cpp:3:
/usr/include/c++/9/functional:211:34: note:                 ‘const std::_Placeholder<1> std::placeholders::_1’
  211 |     extern const _Placeholder<1> _1;
      |                                  ^~
make[2]: *** [CMakeFiles/robot_vision_cpp.dir/build.make:63: CMakeFiles/robot_vision_cpp.dir/src/robot_vision.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/robot_vision_cpp.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Environment: ros2 foxy, ubuntu 20.