Replies: 7 comments 5 replies
-
Well there'a few problems with this that I think don't make it very feasible:
I still think it would work better to have a backend node subscribe to one of the existing messages, and then act as a proxy for executing any external API calls. It should be more reliable and adaptable to any specific configs. Maybe multiple api calls need to be made in for one action, or it might need special handling like waiting for completion. And maybe other ROS nodes need to make these calls as well, which would be impossible if it's on the frontend. There's a lot of fractal complexity that needs to be fairly adhoc for each implementation. |
Beta Was this translation helpful? Give feedback.
-
Hmm I see, well I guess that would work maybe, with your button in Vizanti would it see an api node ? and once connected can you configure what it send to that node ? if so I guess maybe then the API node could make the actual call, im not sure such a rose node exists currently to be honest , any ideas ? Thanks |
Beta Was this translation helpful? Give feedback.
-
Here's another idea, im wondering if there is anyway to make a widget that will show a webpage within vizanti ? that would be a big help with my project especially as one of the webcams on the robot is basically just that and I could do with being able to simply see the stream within vizanti, it also has controls for moving the cam as well, is that possible ? |
Beta Was this translation helpful? Give feedback.
-
Ok so success I have got the iframe solution working ...yay thanks m8, one more issue I have is the battery isn't showing the value , so I know in standard res robots its done under message / sensor_msgs/BatteryState, on my robot the battery percentage is under /slamware_ros_sdk_server_node/robot_basic_state.battery_percentage, where in the code do I set this ? I looked in the src templates battery folder but not sure where else to? |
Beta Was this translation helpful? Give feedback.
-
Would I just save this as a python scipt and run it using python3 filename.py etc and then the battery input should work ?
Thanks
Kurt
From: MoffKalast ***@***.***>
Date: Wednesday, 12 February 2025 at 14:16
To: MoffKalast/vizanti ***@***.***>
Cc: Kurt Ingleson ***@***.***>, Author ***@***.***>
Subject: Re: [MoffKalast/vizanti] Widget that can send api calls (Discussion #132)
Assuming this is the message type<https://developer.slamtec.com/docs/slamware/ros-sdk-en/2.8.2_rtm/msgs/robot_basic_state/>, an extra node that does the conversion from int to float and publishes the standard message would be easiest I think, then you can also grab the temperature, e.g.
#!/usr/bin/env python3
import rospy
from slamware_ros_sdk.msg import RobotBasicState
from sensor_msgs.msg import BatteryState, Temperature
def robot_state_callback(msg):
battery_msg = BatteryState()
battery_msg.header.stamp = rospy.Time.now()
# Convert battery percentage (assumed range 0-100) to 0-1.0 scale
battery_msg.percentage = msg.battery_percentage / 100.0
# Battery status: CHARGING (1) if charging, NOT_CHARGING (3) otherwise
battery_msg.power_supply_status = BatteryState.POWER_SUPPLY_STATUS_CHARGING if msg.is_charging else BatteryState.POWER_SUPPLY_STATUS_NOT_CHARGING
# Voltage and current are unknown (-1 to indicate this)
battery_msg.voltage = -1.0 # Placeholder value
battery_msg.current = -1.0 # Placeholder value
# Assume Li-ion chemistry
battery_msg.power_supply_technology = BatteryState.POWER_SUPPLY_TECHNOLOGY_LION
battery_pub.publish(battery_msg)
# Publish temperature data
temp_msg = Temperature()
temp_msg.header.stamp = rospy.Time.now()
temp_msg.temperature = msg.board_temperature # Assuming board temperature is in Celsius
temp_msg.variance = 0.0 # Unknown variance
temp_pub.publish(temp_msg)
try:
rospy.init_node('battery_state_publisher', anonymous=True)
battery_pub = rospy.Publisher('/athena/battery', BatteryState, queue_size=10)
temp_pub = rospy.Publisher('/athena/temperature', Temperature, queue_size=10)
rospy.Subscriber('/slamware_ros_sdk/robot_basic_state', RobotBasicState, robot_state_callback)
rospy.spin()
except rospy.ROSInterruptException:
pass
—
Reply to this email directly, view it on GitHub<#132 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABHHDN5NKODR77UMKGVSKML2PNJVFAVCNFSM6AAAAABWX3DJIKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMJXGMYTEMY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
yes that has worked , thanks a lot m8 big big help, just one more quick one please if I can , whenever I reset my pc or I access from another pc or browser I have to import my settings every time, is there a way to make vizanti server the same dashboard layout to any client that connects ? ie window positions camera etc etc Thanks again |
Beta Was this translation helpful? Give feedback.
-
That's great m8, now if I could just get the waypoints working I would be sorted :-) still won't follow them for some reason .. im a bit of a noob with ros and can't see the wood for the trees :-) |
Beta Was this translation helpful? Give feedback.
-
So still trying to get =vizanti to send api calls to a web server that connects to my bot , all it needs to do is basically send a http call to a webpage then when the web server hears that it runs a python script that controls the robot. Like http://0.0.0.0/dock.php would tell the robot to dock, the script is run by the webserver so all Vizanti needs to do is basically call the webpage, can that be done ? I looked at the button already but that's configured to link to a ros node, that's not what I need, I imagine the ability to send api calls or web calls would be useful to a few people ?
Beta Was this translation helpful? Give feedback.
All reactions