Ask Your Question

Warrior's profile - activity

2017-06-07 03:37:14 -0600 received badge  Teacher (source)
2017-06-07 03:37:14 -0600 received badge  Self-Learner (source)
2017-05-16 19:38:43 -0600 marked best answer rviz does not run on virtual machine - Illegal instruction (core dumped)

Hi everyone,

I am using Ubuntu 12.04 32-bit on VirtualBox. I just installed the rviz and tried to run it using "rosrun rviz rviz" command. But the followings will be shown and it doesn't start. How can I fix the issue?

[ INFO] [1395806079.738572838]: rviz version 1.10.11
[ INFO] [1395806079.739463083]: compiled against OGRE version 1.7.4 (Cthugha)
[ INFO] [1395806080.677327493]: OpenGl version: 2.1 (GLSL 1.2).
Illegal instruction (core dumped)

I may note that I enabled 3D acceleration before turning on the virtual machine, but the system details there is no sign of having a 128 MB graphics card. Also, I executed the following code, but rviz does not run yet:


Thank you

2017-04-20 17:33:31 -0600 received badge  Famous Question (source)
2015-03-25 05:14:21 -0600 received badge  Taxonomist
2014-08-14 01:03:03 -0600 received badge  Famous Question (source)
2014-05-15 11:04:35 -0600 received badge  Notable Question (source)
2014-05-10 08:02:35 -0600 received badge  Famous Question (source)
2014-04-21 16:14:22 -0600 asked a question Polar coordinates to Cartesian coordinates in inertial frame

Hi everyone,

I am reading sensor data from base_scan topic. The range is between -1.57 to 1.57 radians and angle increment is approximately 0.00872 (361 readings). I want to find the exact (x, y) coordinates of each laser scan data point in the inertial frame but I don't know how I can do that. The only thing I know are the following formulas to find the x and y lengths of each sensor reading, but I don't know how I can get the global coordinate. Do I need to sum the calculated x and y results with the (x, y) of the robot in the inertial frame?

x = range * cos(angle)
y = range * sin(angle)

Also, I don't know what number do I need to use as "angle" in the formulas. Starting from -1.57, should I use -1.57 as the first angle quantity and -1.57 + 0.00872 as the second one?

Thank you

2014-04-20 19:32:39 -0600 received badge  Famous Question (source)
2014-04-19 09:59:24 -0600 received badge  Popular Question (source)
2014-04-18 17:31:27 -0600 received badge  Notable Question (source)
2014-04-18 17:12:29 -0600 commented answer How much to turn to face the goal?

Sorry, I shouldn't have copied the code directly. The "self" thing is used because I am writing my codes in a class. Here's the more understandable code: ((math.atan2(goalY - robotY, goalX - robotX)) * 180/math.pi) - robotAngle. Initially, robotAngle is 180 (the robot is looking backward). So, the quantity of this equation will be the angle that the robot must turn to face the goal. However, the topics that I have subscribed to publish both pose.{x, y, z} along with orientation.{x, y, z, w} quantities. So, suppose my robot starts at the position (-8, -2) and its robot.pose.orientation.z quantity is 1. The goal is also located at (3.5, 8). How can I calculate what should robot.pose.orientation.z be when I am facing the robot? (Sorry I am still a little bit lost)

2014-04-18 09:39:44 -0600 asked a question How to make sure the published commands are executed?

Hi everyone,

I want to turn my robot x degrees to face a desired coordinate(goal). The robot must turn about 100 degrees (1.745 radians), but when I set the angular velocity to 1.745 since the program is running in a loop it doesn't execute the command completely and I don't know how to stop the program at that time to let the turn complete. I thought maybe the robot is not capable of turning at 1.745 radians when received the command, so I thought maybe I should divide 1.745 by, say, 5 and turn the robot 5 times. But I don't know how I can MAKE SURE that the robot has executed the 5 commands I publish.

Thank you

2014-04-18 09:38:11 -0600 received badge  Popular Question (source)
2014-04-18 09:37:36 -0600 commented answer How much to turn to face the goal?

Your way seems to be complicated and I couldn't understand it properly. I may note that my robot is in a 2-D space, not 3D. Does that make sense? I think I figured out the correct way of calculating the degree quantity that the robot must move to face the goal as follow: ((math.atan2(self.goalY - self.robotY, self.goalX - self.robotX)) * 180/math.pi) - self.robotAngle What do you think?

2014-04-17 15:30:55 -0600 asked a question How much to turn to face the goal?


I am implementing a simple algorithm to move the robot towards an assumed goal position in the willow-erratic world map in stage_ros package. I want to calculate the degree quantity that the robot should turn to face the goal. I am using the following equation but it seems that there is a problem with the code since when the robot is turning the quantity doesn't change. Also, when I manually place the robot in a location(1.5, 8) where it should turn 180 degrees to face the goal (3.5, 8), the equation below yields an output of -79.38 which is incorrect. Someone told me I can do this task using quaternions. How can I do that? robotPose.pose.orientation.z is equal to 1 now. How can I use that to find out the degree quantity that the robot need to turn to face the goal?

angle = (math.atan2(goalY - robotPose.pose.position.y, goalX - robotPose.pose.position.x) - math.atan2(robotPose.pose.position.y, robotPose.pose.position.x)) * 180/math.pi

What am I doing wrong?

Thank you

2014-04-15 12:49:51 -0600 received badge  Famous Question (source)
2014-04-15 07:52:07 -0600 commented answer Unable to stop publishing on a topic (Resolved)

Sorry for the delay. I found the solution to the problem and answered my question.

2014-04-15 07:41:28 -0600 answered a question Unable to stop publishing on a topic (Resolved)

The issue is resolved now. I had to add "self." as prefix to all of the variables that I wanted to consider as "global" in a specific class.

Here's the modified code:

class node():

def __init__(self):

    rosInstance = rospy = rosInstance.Publisher('cmd_vel', Twist)
    r = rosInstance.Rate(1)
    self.ctrlArgs = Twist()
    self.iteration = 0
    speed = -0.1

    while not rospy.is_shutdown():
        if iteration < 20:
            self.cntrlArgs.linear.x = 0.2

def iterate(self):
    self.iteration = self.iteration + 1
2014-04-15 05:11:04 -0600 received badge  Notable Question (source)
2014-04-07 23:02:55 -0600 received badge  Famous Question (source)
2014-04-06 17:27:24 -0600 received badge  Commentator
2014-04-06 17:27:24 -0600 commented answer Unable to stop publishing on a topic (Resolved)

I just did. I added the self. prefix to the iteration variable in the iterate() function. Now the program doesn't show me an error, but still doesn't stop the robot moving ... . I really need to resolve this issue.

2014-04-06 17:19:18 -0600 received badge  Popular Question (source)
2014-04-06 08:25:51 -0600 asked a question Unable to stop publishing on a topic (Resolved)


I want to stop publishing a message to a topic after 20 iterations. For that I have written the following piece of code, but however the counter reaches to 20, the program is still publishing the message to the topic and it seems that it is disregarding the counter variable's value. How can I resolve this issue?

class node():

def __init__(self):

    rosInstance = rospy
    pub = rosInstance.Publisher('cmd_vel', Twist)
    r = rosInstance.Rate(1)
    ctrlArgs = Twist()
    iteration = 0
    speed = -0.1

    while not rospy.is_shutdown():
        if iteration < 20:
            cntrlArgs.linear.x = 0.2

def iterate(self):
    iteration = iteration + 1

And then I run the program:

if __name__ == '__main__':

    rospy.init_node('iterator', anonymous=False)
        nn = node()
    except rospy.ROSInterruptException: pass

Thank you

2014-04-01 16:30:05 -0600 received badge  Supporter (source)
2014-03-31 14:23:27 -0600 asked a question Using sensor measurements

Hi everyone,

I have a laser range finder sensor installed on my robot. I am reading the range measurements and I want to move the robot in another direction when facing an obstacle using these measurements. But I do not know how I can do this using these 1082 measurements. Suppose there is an obstacle on the left-front side of the robot. Which portion of these 1082 measurements are showing that area? Do I need to take the Odometry measurements into account also?

Thank you

2014-03-29 08:25:21 -0600 answered a question rviz doesn't launch --> core dumped

Hi everyone,

I had to install Ubuntu besides Windows. As far as I found out, for new graphic cards VirtualBox does not offer good 3D hardware acceleration service! So, I had to install Ubuntu. The problem is solved and rviz runs smoothly.

2014-03-28 18:22:20 -0600 received badge  Notable Question (source)
2014-03-28 03:39:32 -0600 commented answer rviz doesn't launch --> core dumped

The problem still persists :(

2014-03-28 03:20:42 -0600 commented answer rviz doesn't launch --> core dumped

I'm using v. 4.3.6. I am going to update it to the latest.

2014-03-28 01:34:52 -0600 received badge  Notable Question (source)
2014-03-28 01:31:01 -0600 received badge  Popular Question (source)