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

vinjk's profile - activity

2017-03-25 14:31:23 -0500 received badge  Good Answer (source)
2016-12-24 22:18:02 -0500 received badge  Nice Answer (source)
2016-09-14 09:27:50 -0500 received badge  Nice Answer (source)
2015-09-12 19:35:58 -0500 received badge  Famous Question (source)
2015-09-06 09:11:28 -0500 received badge  Notable Question (source)
2015-09-06 06:07:21 -0500 commented question Ikfast computation time

Ok........

2015-09-06 04:36:29 -0500 received badge  Editor
2015-09-06 04:35:42 -0500 answered a question Ikfast computation time

Hi gvdhoorn, I posted the question here because this code was given in ROS wiki http://wiki.ros.org/Industrial/Tutori...

Do you know where I can find the latest version?

2015-09-06 03:38:45 -0500 received badge  Popular Question (source)
2015-09-05 18:01:32 -0500 asked a question Ikfast computation time

The average time calculation in http://kaist-ros-pkg.googlecode.com/s... Says milliseconds but it seems to me it should be microseconds.

Shouldn't it be microseconds? Can anyone clarify this for me?

2015-09-04 21:04:11 -0500 received badge  Famous Question (source)
2015-07-20 04:29:56 -0500 answered a question simple navigation goal

is roscore running?

2015-07-14 22:08:25 -0500 answered a question How do I reset the /odom topic back to 0 without restarting the robot?

This is how odometry is reset for Kobuki:

void KobukiRos::subscribeResetOdometry(const std_msgs::EmptyConstPtr /* msg */)
{
  ROS_INFO_STREAM("Kobuki : Resetting the odometry. [" << name << "].");
  joint_states.position[0] = 0.0; // wheel_left
  joint_states.velocity[0] = 0.0;
  joint_states.position[1] = 0.0; // wheel_right
  joint_states.velocity[1] = 0.0;
  odometry.resetOdometry();
  kobuki.resetOdometry();
  return;
}

Hope this helps.

2015-07-14 02:30:52 -0500 received badge  Enthusiast
2015-07-13 12:06:39 -0500 received badge  Teacher (source)
2015-07-12 22:38:04 -0500 answered a question Manually set a node to subscribe to a topic

i think you can try:

$  rostopic echo /topic_name
2015-07-12 22:28:01 -0500 answered a question Which ROS Version should I use?

For the sake of your sanity, i'd recommend ROS Indigo with Ubuntu 14.04 for the very same reason you highlight in question i.e., many packages are not ready for the new distro.

I too am quite new to ROS environment and Linux...so can't really help you on how to use packages meant for indigo on jade.

2015-07-10 09:29:14 -0500 received badge  Notable Question (source)
2015-07-10 03:37:12 -0500 commented answer Doubt regarding serial communication

Thank you guys for your time.

2015-07-10 03:34:53 -0500 commented question Doubt regarding serial communication

@William I had tried that as well

2015-07-10 03:33:44 -0500 received badge  Supporter (source)
2015-07-10 03:32:58 -0500 received badge  Scholar (source)
2015-07-10 03:32:29 -0500 answered a question Doubt regarding serial communication

Hi @William , @ahendrix

I solved the problem. I did as per William's suggestion used UInt8MultiArray datatype. But before writing it to the serial port I convert it to string.

void write_callback(const std_msgs::UInt8MultiArray::ConstPtr& msg)
{
    std::string str(msg->data.begin(), msg->data.end());
    ser.write(msg->data);
}

I used the command below (just an example) to publish to topic /write

rostopic pub /write std_msgs/UInt8MultiArray '{data: [64,64,11,1,1,1,2,208,32,13,10]}'
2015-07-10 00:39:51 -0500 commented question Doubt regarding serial communication

This is the exact command I tried to run

rostopic pub /write -r 100 std_msgs/String @@1233
2015-07-09 22:21:16 -0500 commented answer Doubt regarding serial communication

[character limit reached in prev comment so writing this here]

I executed this in another terminal

rostopic pub /write std_msgs/UInt8MultiArray '{data: [82, 79, 83]}' -r 1
2015-07-09 22:17:18 -0500 commented answer Doubt regarding serial communication

tried as you suggested. Used std_msgs/UInt8MultiArray instead of std_msgs/String

void write_callback(const std_msgs::UInt8MultiArray::ConstPtr& msg){        
    //ROS_INFO_STREAM("Writing to serial port " << msg->data);
    ser.write(msg->data);
}

Nothing is send or received

2015-07-09 20:46:27 -0500 commented question Doubt regarding serial communication

Sorry about that. The program is the same one made by garyservin (see the link). I've posted the program in my question for your convenience. It's C++ program.

2015-07-09 18:40:41 -0500 received badge  Popular Question (source)
2015-07-09 06:39:47 -0500 asked a question Doubt regarding serial communication

Hi all,

I am new to ROS and Linux. I am using ROS Indigo on Ubuntu 14.04 LTS. I am trying to establish serial communication with an microcontroller using ROS serial package ( https://github.com/wjwwood/serial ). Came across an example program by garyservin ( https://github.com/garyservin/serial-... ). The program works well.

The instruction packet I want to send to MCU has start bytes "@@". However, when I try to publish to this to the topic "write" I get this error:

rostopic: error: Argument error: while scanning for the next token found character '@' that cannot start any token   in "<string>", line 1, column 1:
    @@1233
    ^

Similarly if I try to send a number I get this error:

ERROR: Unable to publish message. One of the fields has an incorrect type:
  field data must be of type str

The datatype used in the example program is std_msgs/String.

What I want to send is actually data in hex code. Something like 0x40 0x40 0x09 0x01 0x00 0x00 0x02 0x0d 0x0a

Could someone guide me on how to solve this problem?

UPDATE

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

serial::Serial ser;

void write_callback(const std_msgs::String::ConstPtr& msg){
    ROS_INFO_STREAM("Writing to serial port" << msg->data);
    ser.write(msg->data);
}

int main (int argc, char** argv){
    ros::init(argc, argv, "serial_example_node");
    ros::NodeHandle nh;

    ros::Subscriber write_sub = nh.subscribe("write", 1000, write_callback);
    ros::Publisher read_pub = nh.advertise<std_msgs::String>("read", 1000);

    try
    {
        ser.setPort("/dev/ttyACM0");
        ser.setBaudrate(9600);
        serial::Timeout to = serial::Timeout::simpleTimeout(1000);
        ser.setTimeout(to);
        ser.open();
    }
    catch (serial::IOException& e)
    {
        ROS_ERROR_STREAM("Unable to open port ");
        return -1;
    }

    if(ser.isOpen()){
        ROS_INFO_STREAM("Serial Port initialized");
    }else{
        return -1;
    }

    ros::Rate loop_rate(5);
    while(ros::ok()){

        ros::spinOnce();

        if(ser.available()){
            ROS_INFO_STREAM("Reading from serial port");
            std_msgs::String result;
            result.data = ser.read(ser.available());
            ROS_INFO_STREAM("Read: " << result.data);
            read_pub.publish(result);
        }
        loop_rate.sleep();

    }
}

Thanks!