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

ElectricRay's profile - activity

2023-09-03 04:09:44 -0500 received badge  Famous Question (source)
2023-09-03 04:09:44 -0500 received badge  Notable Question (source)
2023-08-11 12:52:27 -0500 commented answer Using odometry with motor encoders and visualize in RVIZ

Well I think I need to understand the code better. But I get the point that I need to apply the transformation.

2023-08-09 05:08:19 -0500 commented answer Using odometry with motor encoders and visualize in RVIZ

So @billy, as far I understand what I dod wrong in my code is not adding any transformation here? I should use something

2023-08-09 04:46:58 -0500 commented answer Using odometry with motor encoders and visualize in RVIZ

So @billy, as far I understand what I dod wrong in my code is not adding any transformation here? I should use something

2023-08-09 04:44:13 -0500 edited question Using odometry with motor encoders and visualize in RVIZ

Using odometry with motor encoders and visualize in RVIZ Hello all, After lots of work I have finaly my robot driving c

2023-08-08 09:42:44 -0500 received badge  Popular Question (source)
2023-08-08 08:46:02 -0500 received badge  Notable Question (source)
2023-08-08 03:17:14 -0500 commented answer Using odometry with motor encoders and visualize in RVIZ

Thanks I'll have a better at that tutorial and see if I can figure out what I do wrong regarding this transofrmation.

2023-08-08 03:12:48 -0500 marked best answer Control robot remotely with a joystick

Hello,

I would like to control my robot remotely with a joystick. On a Jetson Nano I have running roscore and I'm able to connect from my desktop to the Jetson over WiFi. But when I plug in the joystick the Jetson doesn't see the Jostick outputs cause it looks to it's own USB ports.

Is there a way that I plug in the joystick into my destop en send the joystick outputs over WiFi to the Jetson so it can be processed too control my motors?

I'm using VMware with Ubuntu 20.04 and ROS Noetic on the Jetson Nano. With ROSSerial I send data to a Arduino which controls the motors.

EDIT: I have tried to run the script on the VM when I run the script and joy_node on the VM I see with echo outputs from the joy_node. Als (for debugging) some print statements in the script. But the data that need to be published is not published. But the weird thing is like I wrote above it all works perfect when I connect the joystick to the Jetson Nano usb port.

import rospy
import math
from std_msgs.msg import Float32
from sensor_msgs.msg import Joy
from r2g2.msg import Control_State

# Global variables used for processing the input value from the joystick
Xvelocity = 0
Yvelocity = 0
Zvelocity = 0
Max_Velocity = 100                              # Max velocity in rpm

# Global variables which will be published for left and right motor speed
Left_Motor_Speed = 0
Right_Motor_Speed = 0
Rotation_Speed = 0

# Initialize control input node
rospy.init_node("control_input", anonymous=True)

# Callback funtion for the Control State of R2G2 depending on the value a different control will be accomplished
def control_state_callback(data):
    rospy.loginfo("Current control state is: %d", data.control_state_value)
    print(data.control_state_value)

def joystick_callback(data):
# Get joystick values max scale from joystick is -1 to 1 for x, y and z axis
    axes = data.axes
    global Yvelocity                             # Y position joystick represents Forward and Backwards velocity
    global Xvelocity                             # X position joystick represents turn angle will be used for difference in motor speed
    #global Zvelocity                             # Z position joystick represents rotation around Bot axis
     #Zvelocity = axes[2] * Max_Velocity           # Scale joystick value to rpm value   
     Yvelocity = axes[1] * Max_Velocity           # Scale joystick value to rpm value
     Xvelocity = axes[0] * Max_Velocity           # Scale joystick value to rpm value   
     process_velocities(Xvelocity, Yvelocity)

def process_velocities(x_val, y_val):
# First check if x and y values are not equal to zero
    if x_val == 0:
        # If the X position of the joystick is 0 than the bot drives straight and not further computation has to be done
        # Therefore both motors run equal speed.
        Left_Motor_Speed = y_val
        Right_Motor_Speed = y_val
    else:
        hyp = math.sqrt(x_val**2 + y_val**2)                # Find the hypothenuse of the two vectors
        vel_factor = abs(y_val/hyp)                         # Compute the cosine and use it as a attenuation factor for one of the wheels
        if x_val > 0:                                       # If x pos joystick is > 0, R2G2 needs to move to left, left motor turns slower as right motor
            Left_Motor_Speed = vel_factor * y_val
            Right_Motor_Speed = y_val
        else:                                               # If ...
(more)
2023-08-08 03:12:07 -0500 commented answer Can't get a good connection remotle with roscore

Thanks! as you can see now I have the rights :)

2023-08-08 03:11:22 -0500 marked best answer Can't get a good connection remotle with roscore

Hello,

For some kind of reason I'm unable to get a good connection remotely with roscore. I have on my Jetson Nano roscore running and setup the ./bashrc file with ip address

export ROS_MASTER_URI=http://192.168.178.63:11311
export ROS_IP=192.168.178.63

When I do a ifconfig on Ubuntu (running on VMware) I get as IP addres 192.168.204.128

So on my Ubuntu VM is set in the ./bashrc file

export ROS_MASTER_URI=http://192.168.178.63:11311
export ROS_IP=192.168.204.128

Now when I run a publisher on my Jetson Nano (e.g. Hello World) and can subscribe to the topic on the destkop Ubuntu machine and see the data comming in. But when I run a publisher on my desktop (e.g. Hello World) the Jetson doesn't see the data comming in. Although when I do a rostopic list it shows the topic.

Does anybody knows how to fix this? I must do something wrong. I think t is the network settings but I cant change the IP addres of the VM, I tried to change it but it did give me the good results I was even unable to connect to roscore.

Some help would be appreciated

2023-08-08 03:11:22 -0500 received badge  Scholar (source)
2023-08-08 01:23:47 -0500 received badge  Self-Learner (source)
2023-08-08 01:23:47 -0500 received badge  Teacher (source)
2023-08-07 11:56:02 -0500 commented question could not establish connection to remote host vscode?

Ok well I don't know what is docker so sorry I can't elp you with that. I created a remote connection by assigning IP ad

2023-08-07 11:54:40 -0500 commented question could not establish connection to remote host vscode?

Ok well I don't know what is docker so sorry I can't elp you with that. I created a remote connection by assigning IP ad

2023-08-06 13:55:49 -0500 commented answer Can't get a good connection remotle with roscore

np, I don't know how I receive points I have two questions answered by myself because I fogured it out eventually and th

2023-08-06 09:48:13 -0500 received badge  Supporter (source)
2023-08-06 09:44:34 -0500 commented question could not establish connection to remote host vscode?

Could you be more specific what you are doing? Which Ros version you are using do you use a virtual machine etc. This wi

2023-08-06 09:44:07 -0500 answered a question could not establish connection to remote host vscode?

Could you be more specific what you are doing? Which Ros version you are using do you use a virtual machine etc. This wi

2023-08-06 09:38:25 -0500 answered a question Control robot remotely with a joystick

This question has been solved by doing as suggested. The node for the control should be running on the desktop and not t

2023-08-06 09:36:17 -0500 commented answer Can't get a good connection remotle with roscore

I tried to do so but I dont have enough points to do this

2023-08-06 09:36:02 -0500 commented answer Can't get a good connection remotle with roscore

I tried to do so but I dont have enough points to do so.

2023-08-06 09:35:04 -0500 asked a question Using odometry with motor encoders and visualize in RVIZ

Using odometry with motor encoders and visualize in RVIZ Hello all, After lots of work I have finaly my robot driving c

2023-08-06 06:59:37 -0500 answered a question Can't get a good connection remotle with roscore

I have figured out what went wrong. It were a couple of things all related to eachother. So as you can see in my questio

2023-08-06 06:59:37 -0500 received badge  Rapid Responder (source)
2023-08-05 08:20:57 -0500 received badge  Popular Question (source)
2023-08-04 13:07:02 -0500 edited question Can't get a good connection remotle with roscore

Can't get a good connection remotle with roscore Hello, For some kind of reason I'm unable to get a good connection rem

2023-08-04 13:07:02 -0500 received badge  Editor (source)
2023-08-04 13:02:51 -0500 asked a question Can't get a good connection remotle with roscore

Can't get a good connection remotle with roscore Hello, For some kind of reason I'm unable to get a good connection rem

2023-08-04 06:22:42 -0500 edited question Control robot remotely with a joystick

Control robot remotely with a joystick Hello, I would like to control my robot remotely with a joystick. On a Jetson Na

2023-08-04 05:50:52 -0500 commented question Control robot remotely with a joystick

Would I do that by just copy it to the VM and than in the terminal do a rosrun f the particular node?

2023-08-04 05:12:43 -0500 commented question Control robot remotely with a joystick

Would I do that by just copy it to the VM and that in the terminal do a rosrun f the particular node?

2023-08-03 12:02:50 -0500 asked a question Control robot remotely with a joystick

Control robot remotely with a joystick Hello, I would like to control my robot remotely with a joystick. On a Jetson Na

2023-08-03 12:02:49 -0500 asked a question Arduino Nano IoT Unable to sync: Possible link problem or link software version mismatch

Arduino Nano IoT Unable to sync: Possible link problem or link software version mismatch Hello All, I keep having the m

2023-05-17 05:06:51 -0500 received badge  Enthusiast