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

boog's profile - activity

2016-04-27 02:00:43 -0500 received badge  Famous Question (source)
2016-04-27 02:00:38 -0500 received badge  Notable Question (source)
2016-04-27 02:00:38 -0500 received badge  Popular Question (source)
2016-04-27 02:00:38 -0500 received badge  Famous Question (source)
2015-11-28 16:24:50 -0500 marked best answer gmapping with vo and arbotix

Hi I am using gmapping with vo data and the vo data shows up fine but it is not connected to the robotmodel (fake turtlebot) so the model doesn't move on rviz. I would like the model to move as I move the kinect camera using the vo data. How can I achieve this transform? I have read the tutorials but I am still confused. I would upload my frames view but I dont have sufficient karma, thanks.

2015-11-13 14:58:39 -0500 received badge  Famous Question (source)
2014-10-12 22:29:36 -0500 received badge  Notable Question (source)
2014-06-19 14:39:33 -0500 received badge  Famous Question (source)
2014-05-29 19:22:49 -0500 received badge  Famous Question (source)
2014-02-06 07:34:08 -0500 received badge  Taxonomist
2014-01-28 17:31:23 -0500 marked best answer Subscribe to quaternion

Hi I am trying to subscribe to a quaternion being published by an nxt compass and using it for odometry orientation. So far the code doesn't work and I am wondering what I've done wrong. Thanks.

#include <ros/ros.h>
#include <tf/transform_broadcaster.h>
#include <nav_msgs/Odometry.h>
#include <nxt_msgs/Compass.h>
#include <boost/assign/list_of.hpp>
#include <math.h>
#include "std_msgs/String.h"

void chatterCallback(const std_msgs::String::ConstPtr& msg)
 {
  ROS_INFO("I heard: [%s]", msg->data.c_str());
 }



int main(int argc, char** argv) {
  ros::init(argc, argv, "odometry_publisher");

  ros::NodeHandle n;
  ros::Publisher odom_pub = n.advertise<nav_msgs::Odometry>("odom", 50);
  tf::TransformBroadcaster odom_broadcaster;

  double x = 0.0;
  double y = 0.0;
  double th = 0.0;

  double vx = 0.1;
  double vy = -0.1;
  double vth = 0.1;


  ros::Time current_time, last_time;
  current_time = ros::Time::now();
  last_time = ros::Time::now();



  ros::Subscriber sub = n.subscribe<nxt_msgs::Compass>("compass", 1000, chatterCallback);



  ros::Rate r(30.0);
  while(n.ok()){

    ros::spinOnce();               // check for incoming messages
    current_time = ros::Time::now();

    //compute odometry in a typical way given the velocities of the robot
    double dt = (current_time - last_time).toSec();
    double delta_x = (vx * cos(th) - vy * sin(th)) * dt;
    double delta_y = (vx * sin(th) + vy * cos(th)) * dt;
    double compass_yaw = atan (compass_angle);

    double compass_angle = 90;
    x += delta_x;
    y += delta_y;

    //std::cout << "x=" << x << " y=" << y << std::endl;
    //since all odometry is 6DOF we'll need a quaternion created from yaw
    geometry_msgs::Quaternion odom_quat = sub;

    //first, we'll publish the transform over tf
    geometry_msgs::TransformStamped odom_trans;
    odom_trans.header.stamp = last_time;//current_time;
    odom_trans.header.frame_id = "odom";
    odom_trans.child_frame_id = "base_link";

    odom_trans.transform.translation.x = x;
    odom_trans.transform.translation.y = y;
    odom_trans.transform.translation.z = 0.0;
    odom_trans.transform.rotation = odom_quat;

    //send the transform
    odom_broadcaster.sendTransform(odom_trans);

    //next, we'll publish the odometry message over ROS
    nav_msgs::Odometry odom;
    odom.header.stamp = current_time;
    odom.header.frame_id = "odom";

    //set the position
    odom.pose.pose.position.x = x;
    odom.pose.pose.position.y = y;
    odom.pose.pose.position.z = 0.0;
    odom.pose.pose.orientation = odom_quat;

    odom.pose.covariance =  boost::assign::list_of(1e-3) (0)   (0)  (0)  (0)  (0)
      (0) (1e-3)  (0)  (0)  (0)  (0)
      (0)   (0)  (1e6) (0)  (0)  (0)
      (0)   (0)   (0) (1e6) (0)  (0)
      (0)   (0)   (0)  (0) (1e6) (0)
      (0)   (0)   (0)  (0)  (0)  (1e3) ; 

    //set the velocity
    odom.child_frame_id = "base_link";
    odom.twist.twist.linear.x = vx;
    odom.twist.twist.linear.y = vy;
    odom.twist.twist.angular.z = vth;

    odom.twist.covariance =  boost::assign::list_of(1e-3) (0)   (0)  (0)  (0)  (0)
      (0) (1e-3)  (0)  (0)  (0)  (0)
      (0)   (0)  (1e6) (0)  (0)  (0)
      (0)   (0)   (0) (1e6) (0)  (0)
      (0)   (0)   (0)  (0) (1e6) (0)
      (0)   (0)   (0)  (0)  (0)  (1e3) ; 

    //publish the message
    odom_pub.publish(odom);
    //std::cout << "published: [" << last_time << " " << current_time << " " << dt << "]" << std::endl;
    last_time = current_time;
    r.sleep();
  }
}

Compile error:

In function ‘int main(int, char**)’:
/opt/ros/groovy/share/fakeOdometry/src/main.cpp:60:43: error: conversion from ‘ros::Subscriber’ to non-scalar type ‘geometry_msgs::Quaternion’ requested
make[2]: *** [CMakeFiles/fake_odometry.dir/src/main.cpp ...
(more)
2013-12-21 22:18:58 -0500 received badge  Notable Question (source)
2013-12-21 22:18:58 -0500 received badge  Popular Question (source)
2013-11-28 13:30:37 -0500 received badge  Famous Question (source)
2013-11-20 16:40:36 -0500 received badge  Famous Question (source)
2013-11-02 11:32:36 -0500 received badge  Famous Question (source)
2013-10-19 23:20:25 -0500 received badge  Popular Question (source)
2013-10-03 21:13:28 -0500 received badge  Popular Question (source)
2013-10-03 21:13:28 -0500 received badge  Notable Question (source)
2013-09-20 01:05:58 -0500 received badge  Notable Question (source)
2013-09-18 14:28:45 -0500 received badge  Notable Question (source)
2013-08-29 11:47:10 -0500 commented question tf view_frames reinstall

I was typing view_frames instead of rosrun tf view_frames as it worked before with just view_frames, thanks for the help.

2013-08-28 00:17:21 -0500 received badge  Popular Question (source)
2013-08-26 10:10:15 -0500 commented question tf view_frames reinstall

yes I did.

2013-08-23 08:17:31 -0500 marked best answer /odom and /vo priority in robot_pose_ekf

Hi, my setup currently is using ccny_rgbd to provide /vo data and then using this with gmapping. If I publish odometry transforms then the vo corrects the odometry too much, what is the best way to change odom so it has a higher priority and robot_pose_ekf takes into account odom more than vo?

2013-08-09 07:38:05 -0500 received badge  Notable Question (source)
2013-08-08 18:06:17 -0500 received badge  Popular Question (source)
2013-08-08 14:50:42 -0500 commented answer Lego NXT-ROS working on Groovy Galapagos?

@msieber, the nxt_msgs won't compile and neither will nxt_ros as it looks for an x86 lib in /usr/lib during rosmake. Any idea how to fix this? (On rpi).

2013-08-08 14:45:28 -0500 asked a question tf view_frames reinstall

Hi, tf commands have disappeared, is there a way to reinstall them (view_frames I need). Thanks.

2013-08-08 13:32:23 -0500 commented answer Raspberry Pi openni USB interface not supported

@cryus are you able to help me install openni_launch on the rpi please?

2013-08-07 10:30:40 -0500 asked a question libpoco-dev install on rpi for class_loader (rpi)

Hi this debian is not working and I have no access to apt-get on the rpi:

http://mirrordirector.raspbian.org/raspbian/pool/main/p/poco/libpoco-dev_1.3.6p1-4_armhf.deb.mirrorlist

But class_loader requires libpoco-dev.

Do you have any suggestions?

Thanks.

2013-08-06 13:31:05 -0500 asked a question libbondcpp.so rpi file for nodelets

Hi while launching openni_launch I get this error

/opt/ros/groovy/lib/nodelet/nodelet error while loading shared libraries: libbondcpp.so not found.

I am wondering if anyone can link me to this file for arm architecture for raspberry pis. (Hopefully with this it will be fixed?) Thanks.

2013-08-05 01:01:23 -0500 received badge  Famous Question (source)
2013-08-03 23:32:15 -0500 received badge  Commentator
2013-08-03 23:30:42 -0500 marked best answer Retrieve velocity data from twist messages

Hello I would like to inspect and pass on the individual velocities from Twist messages, are there methods to do this? Thanks.