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

EwingKang's profile - activity

2019-11-26 21:38:46 -0500 received badge  Famous Question (source)
2019-07-09 03:19:12 -0500 commented question clear_costmap_recovery is not clearing the map

Maybe this info is related to your problem https://github.com/ros-planning/navigation/issues/898#event-2468185242

2019-05-21 07:51:34 -0500 received badge  Notable Question (source)
2019-05-13 02:49:10 -0500 commented question laser_scan_matcher combined with wheel odometry

Not sure if this is relevant, but please check this issue: https://github.com/ccny-ros-pkg/scan_tools/pull/58.

2019-05-01 01:58:56 -0500 commented question Current StaticTransformBroadcaster not update the late-comming rviz

So, to solve the issue, I hacked their code so the staticTransformBroadcaster is called within a 5-sec timer callback.

2019-04-29 10:15:03 -0500 received badge  Popular Question (source)
2019-04-25 04:15:53 -0500 asked a question Current StaticTransformBroadcaster not update the late-comming rviz

Current StaticTransformBroadcaster not update the late-comming rviz So I was playing around with the Intel RealSense and

2019-03-28 04:36:11 -0500 commented answer rosserial - Arduino DUE - sync issues

Thanks! This helps a lot, glad I've googled the issue with "DUE" keyword.

2018-08-31 04:41:22 -0500 received badge  Famous Question (source)
2018-07-23 03:00:25 -0500 commented answer Why does AMCL post-date tf (~transform_tolerance)?

@Stephan Ahh now that you've mentioned that,it seems more reasonable :p. Frankly I don't know the exact reason, maybe th

2018-04-27 05:57:42 -0500 received badge  Necromancer (source)
2018-04-26 22:48:52 -0500 answered a question Why does AMCL post-date tf (~transform_tolerance)?

According to amcl_node.cpp:1380 the tf stamp is actually based on the time stamp of the laser scan plus transform_tolera

2018-04-11 20:08:34 -0500 commented answer ROS2 clock stuck within inhereted class

It worked!!!!!! This is such a stupid error!!! THANK YOU But how interesting I'm getting no error at compile. :/

2018-04-11 20:07:08 -0500 marked best answer ROS2 clock stuck within inhereted class

Hello everyone, my clock always stuck at the moment the node start for the following code. I mimic the coding style of the demo talker node. Am I doing anything wrong?

#include <chrono>
#include "rclcpp/rclcpp.hpp"
#include "rclcpp/clock.hpp"

void xNode::timer_callback()
{
    // do something here
    rclcpp::TimeSource ts(shared_from_this());
    rclcpp::Clock::SharedPtr clk2 = std::make_shared<rclcpp::Clock>(RCL_ROS_TIME);
    ts.attachClock(clk2);
    rclcpp::Clock clk3;//

    if(conditions)
    {
        // stuck at node start time
        RCLCPP_INFO(this->get_logger(), "CONTACT!!! time: %ld", clk2->now());
        RCLCPP_INFO(this->get_logger(), "CONTACT!!! time: %ld", clk3.now());
    }
    return;
}

//====== Constructor ======//
xNode() : Node("node_name")
{
    subscription_ = this->create_subscription<std_msgs::msg::String>(
                           "topic_sub", std::bind(&xNode::topic_callback, this, _1),
                            rmw_qos_profile_sensor_data);
    timer_ = this->create_wall_timer(10ms, std::bind(&xNode::timer_callback, this));
}

Main:

int main(int argc, char *argv[])
{
    rclcpp::init(argc, argv);
    auto node = std::make_shared<xNode>();
    rclcpp::spin(node);

    printf("stop");
    node.reset();   // calling destructor through shared_ptr
    rclcpp::shutdown();
    return 0;
}

You have my appreciation for any advice!

Edit: minimum file:

#include <stdio.h>
#include <chrono>
#include "rclcpp/rclcpp.hpp"
#include "rclcpp/clock.hpp"
#include "rclcpp/time_source.hpp"
#include "std_msgs/msg/string.hpp"

#define TOPIC_CMD "string_cmd"

using namespace std::chrono_literals;
using std::placeholders::_1;

class OmniTestNode : public rclcpp::Node
{
private:
    //rclcpp::Publisher<std_msgs::msg::String>::SharedPtr publisher_;
    rclcpp::Subscription<std_msgs::msg::String>::SharedPtr subscription_;
    rclcpp::TimerBase::SharedPtr timer_;

    void topic_callback(const std_msgs::msg::String::SharedPtr msg)
    {
        // Print the received message
        printf("------- Topic <\"%s\">: \"%s\" recieved.\n", TOPIC_CMD, msg->data.c_str());
        return;
    }

    void timer_callback()
    {
        rclcpp::TimeSource ts(shared_from_this());
        rclcpp::Clock::SharedPtr clk2 = std::make_shared<rclcpp::Clock>(RCL_ROS_TIME);
        ts.attachClock(clk2);
        rclcpp::Clock clk3;

        RCLCPP_INFO(this->get_logger(), "clk2 time: %ld", clk2->now());
        RCLCPP_INFO(this->get_logger(), "clk3 time: %ld", clk3.now());
        RCLCPP_INFO(this->get_logger(), "this->now time: %ld", this->now());
        RCLCPP_INFO(this->get_logger(), "CONTACT!!! time: %ld", std::chrono::system_clock::now());

        return;
    }


public:
    rclcpp::Clock::SharedPtr clock_;
    //====== Constructor ======//
    explicit OmniTestNode() : Node("test_io")
    {
        //publisher_ = this->create_publisher<std_msgs::msg::String>(
        //      TOPIC_DATA, rmw_qos_profile_sensor_data);
        subscription_ = this->create_subscription<std_msgs::msg::String>(
                TOPIC_CMD, std::bind(&OmniTestNode::topic_callback, this, _1),
                rmw_qos_profile_sensor_data);

        timer_ = this->create_wall_timer(1000ms, std::bind(&OmniTestNode::timer_callback, this));
        clock_ = std::make_shared<rclcpp::Clock>(RCL_ROS_TIME);
        //ts_ = std::make_shared<rclcpp::TimeSource>(shared_from_this());
        //ts_ = rclcpp::TimeSource(this);
    }

    //====== Destructor ======//
    virtual ~OmniTestNode()
    {
        printf("Node shutting down, reset all GPIOs");
    }
};


int main(int argc, char *argv[])
{
    rclcpp::init(argc, argv);
    auto node = std::make_shared<OmniTestNode>();

    printf("spin");
    rclcpp::spin(node);
    printf("stop");
    node.reset();
    rclcpp::shutdown();

    return 0;
}

output:

[INFO] [test_io]: clk2 time: 140729497633152
[INFO] [test_io]: clk3 time: 140729497633184
[INFO] [test_io]: this->now time: 140729497633216
[INFO] [test_io]: CONTACT!!! time: 1523415521337332304
[INFO] [test_io]: clk2 time: 140729497633152
[INFO] [test_io]: clk3 time: 140729497633184
[INFO] [test_io]: this->now time: 140729497633216
[INFO] [test_io]: CONTACT!!! time: 1523415522337518648
[INFO] [test_io]: clk2 time: 140729497633152
[INFO] [test_io]: clk3 time: 140729497633184
[INFO] [test_io]: this->now time: 140729497633216
[INFO] [test_io]: CONTACT!!! time: 1523415523338464997
2018-04-11 20:07:08 -0500 received badge  Scholar (source)
2018-04-11 17:01:26 -0500 received badge  Notable Question (source)
2018-04-10 23:14:38 -0500 commented question ROS2 clock stuck within inhereted class

@William, I've posted a one-file node that's still having this issue, thanks.

2018-04-10 21:53:42 -0500 edited question ROS2 clock stuck within inhereted class

ROS2 clock stuck within inhereted class Hello everyone, my clock always stuck at the moment the node start for the follo

2018-04-10 21:52:06 -0500 commented question ROS2 clock stuck within inhereted class

@William, I've posted a one-file node that's still wrong.

2018-04-10 21:51:30 -0500 edited question ROS2 clock stuck within inhereted class

ROS2 clock stuck within inhereted class Hello everyone, my clock always stuck at the moment the node start for the follo

2018-04-10 20:08:16 -0500 commented question ROS2 clock stuck within inhereted class

Also, because this node need to access some motherboard stuff, I'm running ros2 under root access. I.e. executing after

2018-04-10 20:07:07 -0500 commented question ROS2 clock stuck within inhereted class

Hi @William, this->now() acted as same as clk2/clk3, it stucked at something like "CONTACT!!! time: 140735253311824"

2018-04-10 20:06:38 -0500 commented question ROS2 clock stuck within inhereted class

Hi @William, this->now() act as same as clk2/clk3, it stuck at something like "CONTACT!!! time: 140735253311824" no m

2018-04-10 19:18:55 -0500 received badge  Popular Question (source)
2018-04-10 05:50:55 -0500 edited question ROS2 clock stuck within inhereted class

ROS2 clock stuck within inhereted class Hello everyone, my clock always stuck at the moment the node start for the follo

2018-04-10 02:42:46 -0500 edited question ROS2 clock stuck within inhereted class

ROS2 clock stuck within inhereted class Hello everyone, my clock always stuck at the moment the node start for the follo

2018-04-10 02:30:24 -0500 edited question ROS2 clock stuck within inhereted class

ROS2 clock stuck within inhereted class Hello everyone, my clock always stuck at the moment the node start for the follo

2018-04-10 02:29:44 -0500 edited question ROS2 clock stuck within inhereted class

ROS2 clock stuck within inhereted class Hello everyone, my clock always stuck at the moment the node start for the follo

2018-04-10 02:26:44 -0500 asked a question ROS2 clock stuck within inhereted class

ROS2 clock stuck within inhereted class Hello everyone, my clock always stuck at the moment the node start for the follo

2018-02-01 01:23:19 -0500 commented question how to: Building PCL & laser_scan_matcher on Raspberry pi 2

Also, my Raspberry Pi Model B v1.1 gives the info of "ARMv7 Processor rev 5 (v7l)" with command "cat /proc/cpuinfo" and

2018-02-01 01:06:38 -0500 commented question how to: Building PCL & laser_scan_matcher on Raspberry pi 2

Also, my Raspberry Pi Model B v1.1 gives the info of "ARMv7 Processor rev 5 (v7l)" with command "cat /proc/cpuinfo" and

2018-02-01 01:06:38 -0500 received badge  Commentator
2018-02-01 01:02:53 -0500 commented question how to: Building PCL & laser_scan_matcher on Raspberry pi 2

FYI, the cmake/pcl_find_sse.cmake has been changed. Now the line you should edit is around line 19. Line 10 is now comme

2018-01-09 19:27:40 -0500 received badge  Nice Question (source)
2016-09-20 03:35:41 -0500 received badge  Student (source)
2016-09-20 03:35:37 -0500 received badge  Necromancer (source)
2016-09-20 03:35:37 -0500 received badge  Teacher (source)
2016-09-20 03:35:37 -0500 received badge  Self-Learner (source)
2015-12-02 04:02:01 -0500 commented answer Garbled image problem on usb_cam

Hi, can you specify the detail of installing the ffmpeg from source? I've tried to do that with this link: http://trac.ffmpeg.org/wiki/Compilati... but didn't come with success. The YUYV format just doesn't work with Full HD cameras (only 2 FPS!). Thanks!

2015-03-23 21:45:54 -0500 received badge  Editor (source)
2015-03-23 21:44:08 -0500 answered a question [SOLVED] Serial Port read returned short error with arduino uno via bluetootle with rosserial

It truns out it is the problem of baudrate of my bluetooth module! The chip (named YFRobot HC-05) is a china made cheap one and not is a real HC-06 or any official supported chip. The common procedure of setting baudrate in a console just won't work. Finally There is something like a single post in some unkown chinese forum that provides the datasheet (Luckily I can read simplified Chinese ^^). http://www.yfrobot.com/forum.php?mod=...

You have to:

  1. connect PIN SET to 5V
  2. power up
  3. set up some kind of terminal that maps input 'Enter' to '\r\n' (carriage return and new line?). I think this is different from some of the board.
  4. use AT command to change the settings.
    AT+BAUD1---1200
    AT+BAUD2---2400
    AT+BAUD3---4800
    AT+BAUD4---9600(模塊出廠設置是9600頻率)
    AT+BAUD5--19200
    AT+BAUD6--38400
    AT+BAUD7--57600
    AT+BAUD8--115200
    AT+BAUD9--230400
    AT+BAUDA--460800
    AT+BAUDB--921600
    AT+BAUDC-1382400

But baud rate higher then 57600 is not usable on my module. Hope it helps someone.

2015-03-23 21:20:29 -0500 commented question [SOLVED] Serial Port read returned short error with arduino uno via bluetootle with rosserial

@130s OK, I see. I'm not sure whether if it is okay to do so here at ros answers. Some of the Q&A site forbid self-answering the question. Anyway, thanks.

edit: I see the line " you are encourage to answer you own...." when I editing my answer ^_^

2015-03-22 21:08:27 -0500 edited question [SOLVED] Serial Port read returned short error with arduino uno via bluetootle with rosserial

Hi all!

I'm working with arduino car under directly ROS topic command. I have a arduino uno board with Arduino Sensor Shield v5.0 installed. I'm running the basic publish and subscribe tutorial from rosserial:
http://wiki.ros.org/rosserial_arduino...
http://wiki.ros.org/rosserial_arduino...

When using USB shown as dev/ttyACM0, things are doing well.

Then, I'm trying to connect with HC-05 bluetooth module. First I connect it with command:

sudo rfcomm connect /dev/rfcomm0 00:06:71:00:3E:87 1

And the

Then launching rosserial as before with additional argument :

rosrun rosserial_python serial_node.py _port:=/dev/rfcomm0 _baud:=9600

With the tutorial code on the car:

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

ros::NodeHandle  nh;

std_msgs::String str_msg;
ros::Publisher chatter("chatter", &str_msg);

char hello[13] = "hello world!";

void setup()
{
  nh.getHardware()->setBaud(9600);
  nh.initNode();
  nh.advertise(chatter);
}

void loop()
{
  str_msg.data = hello;
  chatter.publish( &str_msg );
  nh.spinOnce();
  delay(1000);
}

The terminal become a waterfall of running warning:

[INFO] [WallTime: 1410329846.797489] ROS Serial Python Node
[INFO] [WallTime: 1410329846.814548] Connecting to /dev/rfcomm0 at 9600 baud
[WARN] [WallTime: 1410329849.792440] Serial Port read returned short (expected 72 bytes, received 8 instead).   
[WARN] [WallTime: 1410329849.793548] Serial Port read failure: 
[INFO] [WallTime: 1410329849.794408] Packet Failed :  Failed to read msg data
[INFO] [WallTime: 1410329849.795036] msg len is 8
[WARN] [WallTime: 1410329850.814268] Serial Port read returned short (expected 16 bytes, received 13 instead).
[WARN] [WallTime: 1410329850.815325] Serial Port read failure: 
[INFO] [WallTime: 1410329850.816327] Packet Failed :  Failed to read msg data
[INFO] [WallTime: 1410329850.816984] msg len is 8

For most of the time its complaining about expected 72 bytes.

And thetopic,

rostopic info chatter

will return result (hello world!) quite randomly (it correctly shows with 1 Hz when using USB)

I've done another experiment on subscribe function. Arduino Car subscribe to std_msgs/Empty and topic is published by

rostopic pub toggle_led std_msgs/Empty --rate=1

The result is similar: some of the command can arrived (by moving the sonar servo) but quite randomly, and sometimes move more then 1 time in 1 second (published in 1Hz).

I've tried to read the source but still couldn't locate the problem.

Any help or suggestion are very welcome, thanks.

edit: It truns out it is the problem of baudrate of my bluetooth module! The chip (YFRobot) is a china made cheap one and not is a real HC-06 or any official supported chip. The common method of setting baudrate in a console just won't work. There is something like a single post in some unkown chinese forum that provides the datasheet (Luckily I can read simplified Chinese ^^). After a weird setup process, it's fine now, except that the module just won't work beyond exceed certain rate (57600 I think).