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

Mav16's profile - activity

2020-12-13 15:45:36 -0500 received badge  Famous Question (source)
2020-06-14 05:27:11 -0500 received badge  Nice Question (source)
2018-07-12 07:32:18 -0500 received badge  Notable Question (source)
2018-03-22 16:31:43 -0500 received badge  Famous Question (source)
2018-03-22 16:31:43 -0500 received badge  Notable Question (source)
2017-11-27 02:23:57 -0500 marked best answer Making packages with metapackage dependencies.

I'm following the Gazebo ROS control tutorial and the following command is creating issues for me.

catkin_create_pkg MYROBOT_control ros_control ros_controllers

I understand that ros_control and ros_controllers are metapackages, but how can I make a the necessary control package that depends on the packages in the dependencies?

Thanks

2017-11-27 02:23:10 -0500 received badge  Famous Question (source)
2017-11-21 12:18:35 -0500 received badge  Famous Question (source)
2017-11-06 02:23:15 -0500 received badge  Popular Question (source)
2017-11-05 14:41:03 -0500 edited question Gazebo spawning model incorrectly.

Gazebo spawning model incorrectly. I am trying to import a custom robot into gazebo. I designed it in solidworks, used t

2017-11-05 14:13:08 -0500 edited question Gazebo spawning model incorrectly.

Gazebo spawning model incorrectly. I am trying to import a custom robot into gazebo. I designed it in solidworks, used t

2017-11-05 14:12:29 -0500 edited question Gazebo spawning model incorrectly.

Gazebo spawning model incorrectly. I am trying to import a custom robot into gazebo. I designed it in solidworks, used t

2017-11-05 14:11:24 -0500 received badge  Famous Question (source)
2017-11-05 01:47:21 -0500 asked a question Gazebo spawning model incorrectly.

Gazebo spawning model incorrectly. I am trying to import a custom robot into gazebo. I designed it in solidworks, used t

2017-09-28 15:05:26 -0500 received badge  Notable Question (source)
2017-09-28 15:05:26 -0500 received badge  Popular Question (source)
2017-07-11 22:42:37 -0500 received badge  Popular Question (source)
2017-07-11 21:30:07 -0500 received badge  Commentator
2017-07-11 21:30:07 -0500 commented answer Making packages with metapackage dependencies.

I want to know how I can add the necessary dependencies if I can't use the metapackages as dependencies as listed in the

2017-07-11 21:20:30 -0500 commented answer Making packages with metapackage dependencies.

When I run catkin_make after running the command listed above, it fails with an error saying "metapackages cannot be use

2017-07-11 19:44:32 -0500 asked a question Making packages with metapackage dependencies.

Making packages with metapackage dependencies. I'm following the Gazebo ROS control tutorial and the following command i

2017-05-26 00:25:27 -0500 received badge  Notable Question (source)
2017-05-25 23:47:26 -0500 received badge  Supporter (source)
2017-05-25 23:47:24 -0500 marked best answer Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

I've written a publisher in Python to publish joint angles to a simple robot. The program only catches KeyboardInterrupt on the very first loop before I've ever published anything. However, as soon as I enter the X&Y values and the code does its thing, it stops responding to KeyboardInterrupt. The programs doesn't publish after I press Ctrl+C but it doesn't quit either. I'm quite stumped, any help would be appreciated. TIA

 #!/usr/bin/env python
import rospy
import math
from std_msgs.msg import Float64
import time


def main():
    while not rospy.is_shutdown():
        try:
            #~ joint = raw_input('Enter joint: ')
            #~ angle =2 float(raw_input('Enter angle in radians: '))
            #~ command(joint,angle)
            x = float(raw_input("Enter end effector X in meters: "))
            y = float(raw_input("Enter end effector Y in meters: "))
            angles = ik(x,y)
            th1 = angles[0]
            th2 = angles[1]
            print('Angles - Shoulder: %f, Elbow: %f' %(th1,th2))
            command('Shoulder',th1*-1)
            command('Elbow',th2*-1)
        except KeyboardInterrupt:
            print('Process shutting down')
            break


def ik(x,y):
    l1 = .390
    l2 = .090

    B = math.sqrt(math.pow(x,2)+math.pow(y,2))
    q1 = math.atan2(y,x)
    q2 = math.acos((math.pow(l1,2)-math.pow(l2,2)+math.pow(B,2))/(2*l1*B))
    th1 = q1+q2
    th2 = math.acos((math.pow(l1,2)+math.pow(l2,2)-math.pow(B,2))/(2*l1*l2))
    return [th1,th2]

def command(joint,angle):
    topic = ('camera_arm/%s_position_controller/command' %joint)
    print topic
    pub = rospy.Publisher(topic,Float64,queue_size=1,latch=True)
    rospy.init_node('commander', anonymous=True)
    rate = rospy.Rate(10)
    if not rospy.is_shutdown():
        rospy.loginfo('Publishing angle %f to %s joint'% (angle, joint))
        pub.publish(angle)
        rate.sleep()
    return 0


if __name__ == '__main__':
    try:
        main()
    except rospy.ROSInterruptException:
        pass

Edit: jayess suggested that my repeated publisher creation might be an issue so I modified the code as follows but the error persists.


#!/usr/bin/env python
import rospy
import math
from std_msgs.msg import Float64
import time


def main():
    rospy.init_node('commander', anonymous=True)
    rate = rospy.Rate(10)
    shoulder  = rospy.Publisher("camera_arm/Shoulder_position_controller/command",Float64,queue_size=1,latch=True)
    elbow = rospy.Publisher("camera_arm/Elbow_position_controller/command",Float64,queue_size=1,latch=True)
    while not rospy.is_shutdown():
        try:
            x = float(raw_input("Enter end effector X in meters: "))
            y = float(raw_input("Enter end effector Y in meters: "))
            angles = ik(x,y)
            th1 = angles[0]
            th2 = angles[1]
            print('Angles - Shoulder: %f, Elbow: %f' %(th1,th2))

            if not rospy.is_shutdown():
                rospy.loginfo('Publishing angle %f to Shoulder joint'% (th1))
                shoulder.publish(th1)
                rate.sleep()
                rospy.loginfo('Publishing angle %f to Elbow joint'% (th2))
                elbow.publish(th2)
                rate.sleep()

        except KeyboardInterrupt:
            print('Process shutting down')
            break


def ik(x,y):
    l1 = .390
    l2 = .090

    B = math.sqrt(math.pow(x,2)+math.pow(y,2))
    q1 = math.atan2(y,x)
    q2 = math.acos((math.pow(l1,2)-math.pow(l2,2)+math.pow(B,2))/(2*l1*B))
    th1 = q1+q2
    th2 = math.acos((math.pow(l1,2)+math.pow(l2,2)-math.pow ...
(more)
2017-05-25 23:47:24 -0500 received badge  Scholar (source)
2017-05-25 23:38:02 -0500 commented answer Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

Yep. This worked. What repercussions will disabling signals have? If you could just edit the main response, I'll mark it

2017-05-25 23:37:23 -0500 commented question Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

@jayess, I haven't done a full workspace analysis on this but for now X=0.3 and Y = 0.1 should work.

2017-05-25 23:36:41 -0500 commented answer Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

Yep. This worked. What repercussions will disabling signals have?

2017-05-25 21:09:31 -0500 commented answer Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

Nope, that didn't fix the issue.

2017-05-25 21:09:11 -0500 commented answer Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

Nope, that didn't help at all.

2017-05-25 21:08:46 -0500 received badge  Popular Question (source)
2017-05-25 20:50:55 -0500 edited question Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

Rospy isn't catching KeyboardInterrupt on the second iteration of the loop I've written a publisher in Python to publish

2017-05-25 20:50:55 -0500 received badge  Editor (source)
2017-05-25 20:49:50 -0500 commented question Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

@jayess, I'm sorry, I edited the main question with the updated code. I'm using Indigo on Ubuntu 14.04. I'm running it l

2017-05-25 20:44:48 -0500 commented question Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

I'm sorry, I edited the main question with the updated code. I'm using Indigo on Ubuntu 14.04. I'm running it like any o

2017-05-25 20:37:14 -0500 edited question Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

Rospy isn't catching KeyboardInterrupt on the second iteration of the loop I've written a publisher in Python to publish

2017-05-25 20:35:34 -0500 commented question Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

I modified the code and moved the node and publisher out of that function. The error persists. It stops catching Keyboar

2017-05-25 19:36:43 -0500 asked a question Rospy isn't catching KeyboardInterrupt on the second iteration of the loop

Rospy isn't catching KeyboardInterrupt on the second iteration of the loop I've written a publisher in Python to publish

2017-04-18 11:28:55 -0500 received badge  Enthusiast
2017-04-17 18:18:39 -0500 asked a question The <xacro:include filename=> fails to call the file

I have a urdf set up and I am trying to call an external .gazebo file using

<xacro:include filename="$(find camera_arm)/robots/camera_arm.gazebo" />

but it can't find the file. What am I doing wrong?

Thanks